Glyph Images in $inlinemenu | Uniface Development | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

—  Results per page  —








— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters
For a group of consecutive words like 'end of support' use Match phrase

sp_Feed Topic RSS sp_TopicIcon
Glyph Images in $inlinemenu
10 Sep 2018
4:55 pm
Avatar
Iain Sharp
Member
Forum Posts: 663
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

I am trying to add glyph images to an existing $inlinemenu. I have tried adding IMAGE=^GLYPHNAME to the properties of the inline menu item. This appears to be ignored. 

Does anyone know of any ‘hidden’ requirements for the glyph (Currently 15×16 >256 colours) or similar to make this work? 

10 Sep 2018
6:12 pm
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1840
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Iain,

IIRC, adding glyphs to menues uses some prefix in the option text separated by <gold>;
^glyphname<GOLD!>optiontext

see

    1. For example: @..\images\file_open.png!Open file

Defining and Using Menus

10 Sep 2018
6:19 pm
Avatar
Iain Sharp
Member
Forum Posts: 663
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Yes, normal menus, however, trying that in inline menus causes the menu to fail to load/refresh. 

The help text for $inlinemenu talks about the properties of the inline option, one of which is Image. 

10 Sep 2018
10:25 pm
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1840
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Sorry, Iain,

you are 100% right that $inlinemenu has a totally different kind of logic.

 

The only other example (using glyphs) I found in u96_menu.zip

It’s under Uniface Samples: “GUI Sample: Menus “

https://unifaceinfo.com/wp-content/uploads/2013/10/u96_menu_readme.html

I just copied some lines out of the XML file

 

;———————-
; Wild style
;———————-
putitem/id pMenu, 1, “TYPE=OPTION&uSEP;TEXT=%%$text(DROPDOWN1)%%%&uSEP;IMAGE=^U8_CMPNEW”
putitem/id pMenu, 2, “TYPE=OPTION&uSEP;TEXT=%%$text(DROPDOWN2)%%%&uSEP;IMAGE=^U8_APSOPEN”
putitem/id pMenu, 3, “TYPE=OPTION&uSEP;TEXT=%%$text(DROPDOWN3)%%%&uSEP;IMAGE=^U_ACCEPT”
putitem/id pMenu, 4, “TYPE=OPTION&uSEP;TEXT=%%$text(DROPDOWN4)%%%&uSEP;IMAGE=^U_STORE”
putitem/id pMenu, 5, “TYPE=OPTION&uSEP;TEXT=%%$text(DROPDOWN5)%%%&uSEP;IMAGE=^U_REMOVE”
putitem/id pMenu, 6, “TYPE=SEPARATOR”
putitem/id pMenu, 7, “TYPE=OPTION&uSEP;TEXT=%%$text(DROPDOWN7)%%%&uSEP;IMAGE=^U_QUIT”

10 Sep 2018
10:26 pm
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1840
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

The download link should be: https://unifaceinfo.com/download/3813/

11 Sep 2018
8:27 am
Avatar
eg
Member
Forum Posts: 7
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Iain,

Do you have the menu=umenu() setting in the [application] section of the .ini? I think by default in some releases it is commented out and then it doesn’t display the icons.

11 Sep 2018
10:00 am
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1840
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Eugene,

In 9606, I just had to change the  uniface\adm\usys.ini
the modification of common\adm\usys.ini had no effect.

; Example of a menu definition
; menu=umenu(font=SansMedium;backcolor=#fdfdfd;forecolor=black;forecolorselect=blue;backcolorselect=#c0ddfc;bordercolorselect=#3399ff)
menu=umenu(font=SansMedium;backcolor=#fdfdfd;forecolor=black;forecolorselect=blue;backcolorselect=#c0ddfc;bordercolorselect=#3399ff)

The trigger code looked like

;PreDisplay trigger
variables
string strMenuItem, strMenuProperties
endvariables

; ———– Insert first menu item in a dynamic menu ————–

;Initialize one menu item in list
StrMenuItem = “”

;Define menu item “Option A”
putitem/id strMenuItem, “TYPE”, “Option”
putitem/id strMenuItem, “TEXT”, “Option A”
putitem/id strMenuItem, “Checked”, “True”

;Insert this item with id “A” into the dynamic menu.
putitem/id $inlinemenu, “A”, strMenuItem

; ———– Insert second menu item in a dynamic menu ————-

;Initialize one menu item in list.
StrMenuItem = “”

;Define menu item “Option B”
putitem/id strMenuItem, “TYPE”, “Option”
putitem/id strMenuItem, “TEXT”, “Option B”
putitem/id strMenuItem, “IMAGE”, “^U8_ARCOK”

;Insert this item with id “B” into the dynamic menu.
putitem/id $inlinemenu, “B”, strMenuItem

Thanks for the tip,
Uli

11 Sep 2018
10:26 am
Avatar
Iain Sharp
Member
Forum Posts: 663
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hmm, I use the /adm switch on startup, so it’s the usys.ini  in the relevant folder that matters. 

However, it appears that  

menu=umenu() 

isn’t good enough, 

if I use

menu=umenu(backcolor=white;forecolor=black;backcolorselect=#0084CC;forecolorselect=white;backcolorfill=flat)

the images show up, now what I have to do is work out what to set to get the rest of the behaviour to be the same as it was before (i.e. system colours etc.)

Seems there is a hidden trick after all. The umenu has to be other than default before the images will show. 

Weird. 

Iain

11 Sep 2018
11:42 am
Avatar
Iain Sharp
Member
Forum Posts: 663
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Seems that, forecolor=black;backcolorfill=flat is a reasonable approximation, I could play about with the backcolorselect to get the exact colour match, but at least I’ve got the pictures working, and can talk to sales about what they want the menus to look like. 

Makes my top menu more spaced out though, I’m worried that the system menu won’t fit on a default screen size any more. 

I’ve got the choice to play with though. 

11 Sep 2018
2:10 pm
Avatar
eg
Member
Forum Posts: 7
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Iain,

You can try the following names:

COLOR_ACTIVEBORDER
COLOR_ACTIVECAPTION
COLOR_APPWORKSPACE
COLOR_BACKGROUND
COLOR_BTNFACE
COLOR_BTNHIGHLIGHT
COLOR_BTNSHADOW
COLOR_BTNTEXT
COLOR_CAPTIONTEXT
COLOR_GRAYTEXT
COLOR_HIGHLIGHT
COLOR_HIGHLIGHTTEXT
COLOR_INACTIVEBORDER
COLOR_INACTIVECAPTION
COLOR_INACTIVECAPTIONTEXT
COLOR_INFOBK
COLOR_INFOTEXT
COLOR_MENU
COLOR_MENUTEXT
COLOR_SCROLLBAR
COLOR_3DDKSHADOW
COLOR_3DFACE
COLOR_3DHILIGHT
COLOR_3DLIGHT
COLOR_3DSHADOW
COLOR_WINDOW
COLOR_WINDOWFRAME
COLOR_WINDOWTEXT
COLOR_HOTLIGHT
COLOR_GRADIENTACTIVECAPTION
COLOR_GRADIENTINACTIVECAPTION
COLOR_MENUHILIGHT
COLOR_MENUBAR

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 131

Currently Online:
26 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ulrich-merkel: 1840

Iain Sharp: 663

Theo Neeskens: 366

gianni: 331

istiller: 285

rogerw: 268

Knut: 219

lalitpct: 197

Arjen van Vliet: 182

sochaz: 173

Member Stats:

Guest Posters: 3

Members: 9740

Moderators: 0

Admins: 8

Forum Stats:

Groups: 1

Forums: 62

Topics: 2270

Posts: 9824

Newest Members:

agrohimujg, Ramhaturiff, best_auto, kings1, skorp0883, oraha, Anitastync, marina1993m, CharlesRip, Angiefoxlome

Administrators: admin: 23, Adrian Gosbell: 318, diseli: 1017, Bob Maier: 3, Nico Peereboom: 80, Michael Rabone: 4, richiet: 406, JanCees: 34