Page 1 of 1

DCMENUBAR

Posted: Wed Feb 11, 2015 2:34 am
by c-tec
Hello,
have two questions:
1. it seems that the height of the menu bars are limited, is there a way to make them higher? I try to optimize my software for tablet and touch user
2. it seems that I cannot define different colors for the vertical bar background than the menu item foreground, they are the same as far I see
regards
Rudolf

Code: Select all

proc main()
******************************************************************
local getlist := {},oMenuBar,oMenu1,cFont := "40.Arial"
local aConfig := array(12)
aConfig[1] := GRA_CLR_PALEGRAY     // A/N    Default Background color of pulldown sub menus
aConfig[2] := GRA_CLR_BLACK        // A/N    Default Foreground color of Vertical Bartext area of sub menus.
aConfig[3] := GRA_CLR_DARKGRAY     // A/N    Default Background color of Vertical Bartext area GraMakeRGBColor({160,200,230})
aConfig[4] := GRA_CLR_WHITE        // A/N    Default Color of menu outline.
aConfig[5] := "40.Arial bold"      // C      Default compound font name of the Vertical Bartext are of sub menus.
aConfig[6] := .t.                  // L/NIL  A logical .TRUE. to enable the OwnerDraw feature  A logical .FALSE. to disable the OwnerDraw feature
aConfig[7] := cFont                // C      Default compound font name of the check character to use when a sub menu item is checked.
aConfig[8] := chr(77)              // C      Default single character to use for the check when a sub menu item is checked.
aConfig[9] := GRA_CLR_WHITE        // A/N    Default MenuBar Foreground Color.
aConfig[10]:= GRA_CLR_DARKBLUE     // A/N    Default MenuBar Background Color.
aConfig[11]:= GRA_CLR_BLUE         // A/N    Default Foreground color of pulldown sub menus
aConfig[12]:= cFont                // C      Default compound font name of the Menubar.
DC_XbpMenuConfig(aConfig)

DCMENUBAR oMenuBar OWNERDRAW
DCSUBMENU oMenu1 PROMPT "Test menu 1" PARENT oMenuBar  BARTEXT "Test Menu 1"
DCMENUITEM "Test 1"   ACTION  {||tone(400,1)} parent oMenu1
DCMENUITEM "Test 2"   ACTION  {||tone(400,1)} parent oMenu1
DCMENUITEM "Test 2"   ACTION  {||tone(400,1)} parent oMenu1

@ 5,5 dcpushbutton caption "check" size 30,2 action {||DC_inspectobject(oMenuBar) }
@ 8,5 dcpushbutton caption "ok" size 30,2 action {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList) }

dcread gu

Re: DCMENUBAR

Posted: Wed Feb 11, 2015 3:23 am
by Wolfgang Ciriack
Hi Rudolf,
see http://bb.donnay-software.com/donnay/vi ... 1376#p7418
Roger had added subclassing for the menu (changed _dcgetbx.prg). I had no time until now to test it, but with subclssing it should be possible to change the measureitem method.

Re: DCMENUBAR

Posted: Wed Feb 11, 2015 1:51 pm
by Auge_Ohr
c-tec wrote:1. it seems that the height of the menu bars are limited, is there a way to make them higher? I try to optimize my software for tablet and touch user
2. it seems that I cannot define different colors for the vertical bar background than the menu item foreground, they are the same as far I see
look at http://bb.donnay-software.com/donnay/vi ... f=2&t=1373

Re: DCMENUBAR

Posted: Fri Feb 13, 2015 12:41 am
by c-tec
Hello,
so I have to subclass the menubar and change the size somewhere I think, but no idea how, a sample would be helpful
regards
Rudolf

Re: DCMENUBAR

Posted: Fri Feb 13, 2015 4:21 am
by Auge_Ohr
c-tec wrote:Hello,
so I have to subclass the menubar and change the size somewhere I think, but no idea how, a sample would be helpful
i do understand right that you want to modify horizontal Menu-Bar using bigger Font ?
MenuBar_24points.PNG
MenuBar_24points.PNG (10.31 KiB) Viewed 9052 times
use c:\ALASKA\XPPW32\Source\samples\basics\OWNERDRW\OWNERDRW.prg

Code: Select all

oMbar:measureItem
oMbar:drawItem
Codeblock Slot. you can use up to 24Point ... not more while Menu-Bar will not increase more height

Code: Select all

#define SM_CYMENU    15
#include "dll.ch"
DLLFUNCTION GetSystemMetrics(xValue) USING STDCALL FROM USER32.DLL

? GetSystemMetrics(SM_CYMENU) // -> 20 + Border + Frame = 24

Re: DCMENUBAR

Posted: Mon Feb 16, 2015 4:50 am
by c-tec
Hello Jimmy,
thank you, the info that 24 is the maximum is important for me. I wil try to make menus with pushbuttons instead, should be no problem with eXpress++
regards
Rudolf