Page 1 of 1
MenuItem with "Checkbox"
Posted: Wed Jan 06, 2021 1:25 am
by AUGE_OHR
hi,
i can use a Bitmap as IMAGE for MenuItem
is it possible to "simulate" a Checkbox (switch Image) and use "Result" ( .T. / .F. ) under harbour HMG

- Menu_CheckItem.jpg (25.46 KiB) Viewed 841 times
Re: MenuItem with "Checkbox"
Posted: Wed Jan 06, 2021 7:49 am
by gfilatov
AUGE_OHR wrote: ↑Wed Jan 06, 2021 1:25 am
hi,
i can use a Bitmap as IMAGE for MenuItem
is it possible to "simulate" a Checkbox (switch Image) and use "Result" ( .T. / .F. ) under harbour HMG
Hi Jimmy,
This feature will require an OWNERDRAW menu items support which is missed in the official HMG.
BTW It is possible in the MiniguiEx with the following simple code:
Code: Select all
/*
* MiniGUI Menu Demo
*/
#include "minigui.ch"
PROCEDURE MAIN
LOCAL n
LOCAL m_char
IF PCount() == 0
SET MENUSTYLE EXTENDED
ELSE
SET MENUSTYLE STANDARD
ENDIF
DEFINE WINDOW Win_1 ;
AT 0, 0 ;
WIDTH 400 ;
HEIGHT 400 ;
TITLE 'Menu Demo 2' ;
MAIN
DEFINE MAIN MENU
POPUP "&Option"
FOR n := 1 TO 3
m_char := 'item' + StrZero( n, 2 )
MENUITEM 'EXE ' + m_char ACTION MenuProc() NAME &m_char CHECKED
NEXT
Win_1.item02.Checked := .F.
SEPARATOR
MENUITEM 'Exit' ACTION Win_1.Release
END POPUP
POPUP '&Help'
MENUITEM '&About' ACTION MsgInfo ( MiniGuiVersion(1) )
END POPUP
END MENU
IF IsExtendedMenuStyleActive()
HMG_SetMenuTheme( MNUCLR_THEME_DARK )
ENDIF
END WINDOW
ACTIVATE WINDOW Win_1
RETURN
PROCEDURE MenuProc()
IF This.Name == '01'
MsgInfo ( 'Action 01', This.Caption )
ELSEIF This.Name == '02'
MsgInfo ( 'Action 02', This.Caption )
ELSEIF This.Name == '03'
MsgInfo ( 'Action 03', This.Caption )
ENDIF
RETURN
Take a look for a result image below: