DEFINE DROPDOWN MENU BUTTON with SEPARATORs

Moderator: Rathinagiri

Post Reply
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

DEFINE DROPDOWN MENU BUTTON with SEPARATORs

Post by Pablo César »

Hi Claudio,

When defined DROPDOWN MENU owned at an button in ToolBar is not being positioned in the right position.
 
Screen114.png
Screen114.png (24.15 KiB) Viewed 1637 times
 
It should be just underneath of the button item but is not when SEPARATORs been defined... :|
 
Screen112.png
Screen112.png (18.47 KiB) Viewed 1637 times
But this is without SEPARATORs... :cry:
 
This I supposed to be due DROPDOWN MENU has not considered the amount of SEPARATORs been defined. It should increases width size of each SEPARATOR and set to COL of DROPDOWN MENU.
 
Screen113.png
Screen113.png (28.93 KiB) Viewed 1642 times
 
I do not know if there is any function that I can move the DROPDOWN MENU manually.

Aesthetically it gets very strange the menu displacement and the worse I love to use SEPARATOR on each button especially when it is inside a SPLITBOX.
 
Googled
Hola Claudio,

Cuando se define DROPDOWN MENU con propiedad de un botón de ToolBar, no me lo coloca en la posición correcta.
Screen114.png
Screen114.png (24.15 KiB) Viewed 1637 times
La posición debe ser justo debajo del elemento del botón, pero no lo hace cuando hay SEPARATORs definidos ... :|
Screen112.png
Screen112.png (18.47 KiB) Viewed 1637 times
Pero aqui está sin SEPARATORs... :cry:

Yo pienso que esto ocurre cuando el DROPDOWN MENU no registró/consideró la cantidad de SEPARATORs que se han definidos.
Deberia considerar el ancho de cada SEPARATOR sumandolo y establecer en COL adecuado para DROPDOWN MENU pueda ser exibido.
Screen113.png
Screen113.png (28.93 KiB) Viewed 1642 times
No sé si hay alguna función que pueda mover manualmente el menú DROPDOWN.

Estéticamente queda muy extraño ese desplazamiento del menú y lo peor a mi me encanta utilizar SEPARATOR en cada botón, especialmente cuando se encuentran dentro de un SPLITBOX.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: DEFINE DROPDOWN MENU BUTTON with SEPARATORs

Post by srvet_claudio »

I will check
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

DEFINE DROPDOWN MENU BUTTON with SEPARATORs

Post by Pablo César »

Thank you Claudio.

To make easier your check up, you can take this demo:

Code: Select all

#include "hmg.ch"

Function Main
DEFINE WINDOW Form_1 ;
	AT 0,0 ;
	WIDTH 940 HEIGHT 480 ;
	TITLE 'HMG ToolBar Demo' ;
	MAIN

	DEFINE SPLITBOX 

		DEFINE TOOLBAR ToolBar_a BUTTONSIZE 45,40 FLAT

			BUTTON Button_1a CAPTION 'Undo' ACTION MsgInfo('Click! 1') SEPARATOR
			BUTTON Button_2a CAPTION 'Back' ACTION MsgInfo('Click! 1') SEPARATOR
			BUTTON Button_3a CAPTION 'Go' ACTION MsgInfo('Click! 1') SEPARATOR
			BUTTON Button_4a CAPTION 'Save' ACTION MsgInfo("Save") DROPDOWN SEPARATOR
			BUTTON Button_1b CAPTION 'More ToolBars...' ACTION MsgInfo('Click! 2') SEPARATOR
			DEFINE DROPDOWN MENU BUTTON Button_4a 
				ITEM 'Exit'	 ACTION Form_1.Release
				ITEM 'About' ACTION MsgInfo ("HMG ToolBar Demo") 
			END MENU
			BUTTON Button_2b CAPTION 'Button 2' ACTION MsgInfo('Click! 2') SEPARATOR
			BUTTON Button_3b CAPTION 'Close' ACTION MsgInfo('Click! 3') DROPDOWN SEPARATOR
			DEFINE DROPDOWN MENU BUTTON Button_3b 
				ITEM 'Disable ToolBar 1 Button 1' ACTION Form_1.Button_1a.Enabled := .F.
				ITEM 'Enable ToolBar 1 Button 1'  ACTION Form_1.Button_1a.Enabled := .T.
			END MENU
			BUTTON Button_4b CAPTION 'Button 4' ACTION MsgInfo('Click! 3') SEPARATOR

		END TOOLBAR

	END SPLITBOX

END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return Nil
 
You will see dropdown menus, will looks like this:
 
Screen118.png
Screen118.png (11.27 KiB) Viewed 1569 times
 
And never mind if is themed window or not.

I have exaggerated with many SEPARATORs, just for showing you what I mean.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply