Vertically align TextBoxControl edit areas on Ribbon

Not Answered This post has 0 verified answers | 5 Replies | 2 Followers Thread's RSS feed.

Sam Mackrill
Points 185
Replied On: Wed, May 2 2012 4:53 AM Reply

I have a Ribbon (UltraWinToolbar) with 3 TextBoxTools on it in a vertical arrangement a bit like:

| Short Caption: [xxxxxxxxxxxxxxxxxxxxxx] |
| Very Long Caption Indeed: [xxxxxxxxxxx] |
| Tiny: [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx] |

But I want it to look like this:

| Short Caption:            [xxxxxxxxxxx] |
| Very Long Caption Indeed: [xxxxxxxxxxx] |
| Tiny:                     [xxxxxxxxxxx] |

How can I control the width of the edit area? Using 2010.3 but can upgrade to 2011.2 if required.

  • Post Points: 20

All Replies

Replied On: Thu, May 3 2012 5:01 PM Reply

Hi Sam,

I have found that this behavior only appears to be produced when TextBoxTools are displayed within the ApplicationMenu of the UltraToolbarsManager; which contains these tools within the context of a popupmenu.

There is no property extended from the UltraToolbarsManager for explicitly adjusting the position of these tools, but you should be able to manipulate their placement with the implementation of a CreationFilter.

I am currently developing one such approach and I will post my solution to this thread, when successful.

If you have any further questions at all in the meantime, please let me know.

Sincerely,
Chris K
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support

  • Post Points: 20
Sam Mackrill
Points 185
Replied On: Fri, May 4 2012 3:51 AM Reply

Chris,

Thanks. I have found that setting the SharedProps.Width to -1 makes the tools line-up properly. However this does not allow us to control the width of the text input area. Setting SharedProps.MinWidth just changes the gap between the label and the text entry area.

  • Post Points: 20
Replied On: Fri, May 4 2012 11:25 AM Reply

Hi Sam,

I have attached the sample demonstrating the CreationFilter implementation that I mentioned yesterday.

In this approach, I have also extended the ability to modify both the ApplicationMenu’s LeftToolsArea and the TextEditor width.

Please find the sample attached.

If you have any questions at all regarding this implementation, please let me know.

Sincerely,
Chris K
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support

  • Post Points: 20
Sam Mackrill
Points 185
Replied On: Fri, May 4 2012 1:08 PM Reply

Chris,

Thanks, I can understand your approach here, unfortunately I couldn't get your code to work on my Ribbon.

I think there is an issue with the rect.X calculation. I have changed it to:

                    //Offset the rect position using the width of its parent container less the desired width of the textEditor, subtract 2 from this quantity

                    rect.X += rect.Width - textEditorWidth;

and it now works, I don't quite understand the purpose of the LeftToolsAreaRight it never seems to get set on my Ribbon.

--

Sam

 

  • Post Points: 20
Replied On: Fri, May 4 2012 3:28 PM Reply

Hi Sam,

Your certainly welcome. The variable name LeftToolsAreaRight was meant to indicate the right border of the ApplicationMenuLeftAreaUIElement and this is the x-axis position that it references; but it was not intended to actually be used for modifying the ToolLeftArea's width, this may have been ambiguous in the sample.

This was used in the calculation to determine the appropriate distance from the right border, (in addition to the 2 unit buffer) for the textEditor’s UIElement; when this elements width is considered.

For modifying the width of the ApplicationMenu.ToolAreaLeft, I would recommend modifying the MinWidth as demonstrated in the sample’s load event, (ultraToolbarsManager1.Ribbon.ApplicationMenu.ToolAreaLeft.MinWidth = <desired width>;).

If you have any further questions regarding this implementation, please let me know.

Sincerely,
Chris K
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support

 

  • Post Points: 5
Page 1 of 1 (6 items) | RSS