Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Evaluating Pro version - TableCaption (Read 7175 times)
Carlos_Rocha
Junior Member
**
Offline


I love Jazz

Posts: 70
Joined: Mar 26th, 2010
Evaluating Pro version - TableCaption
Mar 26th, 2010 at 4:46pm
Print Post  
Hi,

I'm just starting FCX Pro evaluation, and I already lost a night trying to find out how to control TableCaption behavior.

Just after a table creation, I want to let the user to assign some text to the caption, so I call Table.BeginInplaceEdit(-1, -1) to create the inline editbox. This works, but I still couldn't solve:

1. the font used while editing is not the font used for the caption.
2. I couldn't catch Keys while editing (I need Esc and Enter).
3. I couldn't resize the caption to fit the caption text

Is this possible at all?

Thanks
  
Back to top
 
IP Logged
 
Carlos_Rocha
Junior Member
**
Offline


I love Jazz

Posts: 70
Joined: Mar 26th, 2010
Re: Evaluating Pro version - TableCaption
Reply #1 - Mar 26th, 2010 at 5:12pm
Print Post  
Solved 3. with fcx.MeasureString and SetSize
8)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Evaluating Pro version - TableCaption
Reply #2 - Mar 26th, 2010 at 7:33pm
Print Post  
Hi,

You can do 1 and 2 only through the Windows API. First get a window handle for the edit control as shown here:
http://mindfusion.eu/Forum/YaBB.pl?board=fcx_disc;action=display;num=1254523850;...

1. Send WM_SETFONT to change its font.
2. Use window subclassing to detect Esc and Enter keys. For a VB6 example, check here:
http://www.vb-helper.com/tutorial_subclassing.html

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Carlos_Rocha
Junior Member
**
Offline


I love Jazz

Posts: 70
Joined: Mar 26th, 2010
Re: Evaluating Pro version - TableCaption
Reply #3 - Mar 26th, 2010 at 10:41pm
Print Post  
Hello Stoyo,

Number 1 seems easy.
I'll see what I can do about 2, because I don't use VB.

Thank you for your fast reply.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Evaluating Pro version - TableCaption
Reply #4 - Mar 28th, 2010 at 10:27am
Print Post  
Hi Carlos,

We have added InplaceEditAcceptOnEnter and InplaceEditCancelOnEsc properties here:
https://mindfusion.eu/_beta/flowchartx32_inplacekeys.zip

CancelOnEsc is enabled by default, AcceptOnEnter is disabled. We have not updated the control's property-bag serialization code, so you might not be able to set them from a design-time form editor, depending on how your IDE sets properties. In such case, set them from code, e.g. in response to a window.load or similar event.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Carlos_Rocha
Junior Member
**
Offline


I love Jazz

Posts: 70
Joined: Mar 26th, 2010
Re: Evaluating Pro version - TableCaption
Reply #5 - Mar 28th, 2010 at 4:33pm
Print Post  
Amazing support, and I'm still not a client (yet) Cheesy

Thanks a lot
  
Back to top
 
IP Logged
 
Carlos_Rocha
Junior Member
**
Offline


I love Jazz

Posts: 70
Joined: Mar 26th, 2010
Re: Evaluating Pro version - TableCaption
Reply #6 - Mar 30th, 2010 at 5:13pm
Print Post  
Hi Stoyo,

The new properties work as expected and can save us lots of code. Thank you again for that. Cheesy

About InPlaceEditFont, I still couldn't put it to work (maybe because the Font is an OleFont and I have no simple way to get it's handle). But don't you think that the EditBox should use fcx.font by default? Just a thought.
  
Back to top
 
IP Logged
 
Carlos_Rocha
Junior Member
**
Offline


I love Jazz

Posts: 70
Joined: Mar 26th, 2010
Re: Evaluating Pro version - TableCaption
Reply #7 - Apr 1st, 2010 at 1:16am
Print Post  
Hello Stoyo,

Sorry, still a problem with InPlaceEditCancelOnEsc:

I'm trying to create a system to define table columns for a database. To do so, I display the table with one more row saying "<Add Column>" in a lighter color.
The idea is to let the user click that cell to define a new column name. So, I clear the cell content before BeginInPlaceEdit. But if the user "Escapes" from the edit control, CellTextEdited is not called and I can't reassign "<Add Column>" to the cell.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Evaluating Pro version - TableCaption
Reply #8 - Apr 1st, 2010 at 11:20am
Print Post  
BeginInplaceEdit returns immediately, so you can handle CellDoubleClicked like this:

table.SetText col, row, ""
table.BeginInplaceEdit col, row
table.SetText col, row, "<add column>"

Now if the user presses ESC, the "<add column>" text remains, otherwise the cell's text will be changed to what the user has entered.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Carlos_Rocha
Junior Member
**
Offline


I love Jazz

Posts: 70
Joined: Mar 26th, 2010
Re: Evaluating Pro version - TableCaption
Reply #9 - Apr 1st, 2010 at 1:02pm
Print Post  
Perfect. Thank you
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint