Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How to control width distance of each menu item Collapse All
Subject Author Date
cheng cheng Sep 10, 2007 - 4:10 PM

Hi everybody,

How to control width distance of each menu item? Because I use Traditional Chinese language to replace English language,
but the distance of each menu item is too narrow. How to setup different distance of menu item in width? Thanks.

By the way,Prof-UIS use Tahoma font as default font,how to use different font name as default font? Thanks.

BR,

cheng cheng Sep 13, 2007 - 3:57 PM

>>GetTextMargins()/SetTextMargins()
>>GetIconMargins()/SetIconMargins()
Thank ’Technical Support’,it is easy to do it. Thanks.

By the way,from example file ’ProfUIS_Controls’,I try to change icon position of button for ’with menu’ button.
How to change icon position of button? I mean icon is too near left side for button with icon.
Does it also have ’SetIconMargins()’ function?

Thanks.

Technical Support Sep 14, 2007 - 7:14 AM

Yes, the same feature is available in CExtButton too. Take a look at the Buttons page in the Prof-UIS_Controls sample. You can see how to change the alignment and margin properties of the text and icon in the button (see screenshot).


Technical Support Sep 13, 2007 - 11:21 AM

Please note in 2.80 there were added a set of methods to the CExtBarButton class so that you can control the margins of the icon and text of the toolbar buttons and, accordingly, of the menu buttons:

GetTextMargins()/SetTextMargins() 
GetIconMargins()/SetIconMargins()
You can use the CExtToolControlBar::GetButton() method for retrieving the CExtBarButton button.

cheng cheng Sep 11, 2007 - 3:46 PM

Sorry! For the above statement I explain it again.

File (2 pixels) Edit (2 pixels) View (2 pixels) Help ===> File (6 pixels) Edit (6 pixels) View (6 pixels) Help

How to control the distance between menu item for File and Edit? Thanks.

Technical Support Sep 12, 2007 - 1:03 PM

There are at least two ways to make menu bar’s buttons wider:

1) Simple way. You should use " File " string instead of the "File" string in the menu resource.

2) The CExtMenuControlBar class, which implements a menu bar is derived from CExtToolControlBar, which implements a toolbar. That means the menu bar is kind of advanced version of the toolbar. The top menu level in the menu bar is implemented as an array of toolbar buttons where each button is an instance of the CExtBarButton class. You can create and use your CExtMenuControlBar-derived class which implements the following virtual method:

virtual CExtBarButton * OnCreateBarCommandBtn( UINT nCmdID, UINT nStyle = 0 )
{
      ASSERT_VALID( this );
CExtBarButton * pTBB = new CYourToolBarButtonClass( this, nCmdID, nStyle );
      ASSERT_VALID( pTBB );
      return pTBB;
}
CYourToolBarButtonClass in the above code is derived from CExtBarButton and implements the CExtBarButton::CalculateLayout() virtual method. Your version of the CalculateLayout() virtual method should invoke the parent class’s method and return an object of increased size in correspondence with the increased size of menu bar’s buttons.

cheng cheng Sep 11, 2007 - 3:41 PM

Sir,

I can try to understand how to change font from the FunnyBars. Thanks.

But how to change the width distance of each menu item,for example
File Edit View Help =====> File Edit View Help

Thanks.

Technical Support Sep 11, 2007 - 9:38 AM

In Prof-UIS menu items are measured using the g_PaintManager->m_FontNormal font, which is the same as the default GUI font in most of Prof-UIS themes. You can change this font as it is demonstrated in the FunnyBars sample where you can select a font for toolbars and menus in the combo box in the main form view. We guess you need some font which is preferred for displaying Chinese Traditional strings.