Page 1 of 1

DC_XbpMenuConfig()

Posted: Mon Jan 02, 2023 1:41 pm
by unixkd
Happy new year to all members.

aCfg := DC_XbpMenuConfig()
aCfg[11] := GRA_CLR_DARKBLUE // NOT WORKING
DC_XbpMenuConfig(aCfg)

Joe
#include "dcdialog.ch"
#include "gra.ch"


FUNCTION XSample_9()
Local aCfg := DC_XbpMenuConfig()
LOCAL GetList := {}, oFileMenu, oMenuBar, oEditMenu, oMemo, oUtilMenu, ;
cMemo, nIndex, oDlg, oMsgBox, lCheckItem :=.t., nCheckIndex, ;
oExitMenu
aCfg[6] := .f.
aCfg[9] := GRA_CLR_DARKGREEN
aCfg[11] := GRA_CLR_DARKBLUE // NOT WORKING
DC_XbpMenuConfig(aCfg)
DCMENUBAR oMenuBar OWNERDRAW

DCSUBMENU oFileMenu PROMPT "&File" PARENT oMenuBar ;
MESSAGE 'These are FILE selections' INTO oMsgBox

DCMENUITEM "&Open a File" PARENT oFileMenu ;
MESSAGE 'This selection opens a New File' ;
INTO oMsgBox ;
ACTION {||DC_Msgbox('OpenFile')}

DCMENUITEM "&Close File" PARENT oFileMenu ;
MESSAGE 'This selection closes the currently selected file' ;
INTO oMsgBox ;
ACTION {||DC_Msgbox('CloseFile')}

DCMENUITEM "&Pack File" PARENT oFileMenu ;
MESSAGE 'This selection permanently removes deleted records' ;
INTO oMsgBox ;
ACTION {||DC_Msgbox('Packfile')}

DCSUBMENU oEditMenu PROMPT "&Edit" PARENT oMenuBar ;
MESSAGE 'These are EDIT selections' INTO oMsgBox

DCMENUITEM BITMAP_NEXT_1 PARENT oEditMenu ;
ACTION {|| DC_Winalert("Next")};
MESSAGE 'Go to the NEXT record' INTO oMsgBox

DCMENUITEM BITMAP_PREVIOUS_1 PARENT oEditMenu ;
ACTION {||DC_Winalert("Previous")};
MESSAGE 'Go to the PREVIOUS record' INTO oMsgBox

DCMENUITEM BITMAP_TOP_1 PARENT oEditMenu ;
ACTION {||DC_Winalert("Top")};
MESSAGE 'Go the the TOP of the file' INTO oMsgBox

DCMENUITEM BITMAP_BOTTOM_1 PARENT oEditMenu ;
ACTION {||DC_Winalert("Bottom")};
MESSAGE 'Go to the BOTTOM of the file' INTO oMsgBox

DCSUBMENU oUtilMenu PROMPT "&Util" PARENT oMenuBar ;
MESSAGE 'These are UTILITIES' INTO oMsgBox

DCMENUITEM "&Copy File" PARENT oUtilMenu ;
ACTION {||DC_Msgbox('CopyFile')} ;
MESSAGE 'Copy a file' INTO oMsgBox

DCMENUITEM "&Move File" PARENT oUtilMenu ;
ACTION {||Msgbox('MoveFile')} ;
MESSAGE 'Move a file' INTO oMsgBox

DCMENUITEM "Toggle Check" PARENT oUtilMenu ;
INDEX nCheckIndex ;
CHECKED ;
ACTION {||lCheckItem := !lCheckItem, ;
oUtilMenu:CheckItem(nCheckIndex,lCheckItem)} ;
MESSAGE 'Click here to Toggle Check Mark' INTO oMsgBox

DCSUBMENU oExitMenu PROMPT "E~xit" PARENT oMenuBar ;
MESSAGE 'This will EXIT the Menu Demo' INTO oMsgBox ;
ACTION {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)}

@ 10,0 DCMESSAGEBOX OBJECT oMsgBox SIZE 70,1.5 FONT '10.Arial Bold'

DCREAD GUI ;
TITLE 'Menu Demo' ;
FIT ;
MODAL ;
SETAPPWINDOW ;
PARENT @oDlg ;
BUTTONS DCGUI_BUTTON_OK + DCGUI_BUTTON_CANCEL

RETURN nil

Re: DC_XbpMenuConfig()

Posted: Wed Jan 04, 2023 11:46 am
by rdonnay
I ran your sample and I don't see any problem.

What is the date of your dclipx.dll?