1
1
Fork 0
mirror of https://github.com/FellippeHeitor/InForm.git synced 2025-01-15 11:59:34 +00:00

New property for menu items: .BulletStyle.

Values: __UI_Bullet or __UI_CheckMark.
This commit is contained in:
FellippeHeitor 2018-05-22 23:22:37 -03:00
parent c2de19c791
commit 600026a3c2
3 changed files with 13 additions and 1 deletions

View file

@ -116,6 +116,7 @@ TYPE __UI_ControlTYPE
FocusState AS LONG
LastChange AS DOUBLE
Redraw AS _BYTE
BulletStyle AS _BYTE
END TYPE
TYPE __UI_Types
@ -5864,6 +5865,11 @@ FUNCTION __UI_Bottom%%: __UI_Bottom%% = 2: END FUNCTION
FUNCTION __UI_NumericWithoutBounds%%: __UI_NumericWithoutBounds%% = True: END FUNCTION
FUNCTION __UI_NumericWithBounds%%: __UI_NumericWithBounds%% = 2: END FUNCTION
'BulletStyle
FUNCTION __UI_CheckMark%%: __UI_CheckMark%% = 0: END FUNCTION
FUNCTION __UI_Bullet%%: __UI_Bullet%% = 1: END FUNCTION
'Messagebox constants
FUNCTION MsgBox_OkOnly%%: MsgBox_OkOnly%% = 0: END FUNCTION
FUNCTION MsgBox_OkCancel%%: MsgBox_OkCancel%% = 1: END FUNCTION

View file

@ -104,9 +104,11 @@ SUB __UI_LoadForm
__UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "EditMenuCP437", 182, 18, 0, 46, __UI_GetID("EditMenu"))
SetCaption __UI_NewID, "Use code page OEM-437"
Control(__UI_NewID).BulletStyle = __UI_Bullet%%
__UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "EditMenuCP1252", 218, 18, 0, 64, __UI_GetID("EditMenu"))
SetCaption __UI_NewID, "Use code page &Windows-1252-"
Control(__UI_NewID).BulletStyle = __UI_Bullet%%
__UI_NewID = __UI_NewControl(__UI_Type_MenuItem, "EditMenuSetDefaultButton", 103, 18, 0, 88, __UI_GetID("EditMenu"))
SetCaption __UI_NewID, "Set as &default button"

View file

@ -1562,7 +1562,11 @@ SUB __UI_DrawMenuPanel (This AS __UI_ControlTYPE, ControlState AS _BYTE)
IF Control(i).Value = True THEN
'Checked menu item
IF Control(i).BulletStyle = __UI_Bullet%% THEN
__UI_PrintString __UI_MenuItemOffset \ 2 - __UI_PrintWidth(CHR$(7)) \ 2, Control(i).Top + Control(i).Height \ 2 - uheight \ 2, CHR$(7)
ELSE
_PUTIMAGE (__UI_MenuItemOffset \ 2 - CheckMarkWidth \ 2, Control(i).Top + Control(i).Height \ 2 - CheckMarkHeight \ 2), ControlImage, , (0, CheckMarkIndex * CheckMarkHeight - CheckMarkHeight)-STEP(6, 6)
END IF
ELSE
'Does this menu item have a helper canvas (icon)?
DIM IconRatio AS INTEGER, IconWidth AS INTEGER, IconHeight AS INTEGER