Re: [fltk.general] Changing an Fl_Menu_Bar item colors
True; this would be quite challenging to achieve as Fl_Menu_Item provides only plain draw(). For the similar reason (to add icons support inside menu items) I had to literally 'fork' the whole menu hierarchy :S Sanel On Thu, Jan 31, 2013 at 05:50:21AM -0800, MacArthur, Ian (Selex ES, UK) wrote: Thanks for the reply. This code works well for changing the text foreground color. However I also need to change the background color (the gray box behind the text). Any ideas how to change the background color in an Fl_Menu_Bar item? I don't think there is an easy fix for this (though hopefully others will know better!) but you might be able to make it so... The method that actually draws the menu items, Fl_Menu_Item::draw(...), is defined in Fl_Menu.cxx, so I guess it might be possible to derive your own Fl_Menu class (and maybe also Fl_Menu_Bar class and Fl_Menu_Item struct...) and then add in the ability to set the menu item background... Note that Fl_Menu_Item::draw(...) actually can cope with drawing different boxtypes and colours and so forth, but there's no way to ask for those features for regular menu items, it is meant for menu buttons and so forth... Though maybe you can do something with selection_color(); I wonder if that would work...? Um, probably not... Anyway; best bet is probably to hope that Sanel or someone knows a workaround for this! Cheers, -- Ian This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Changing an Fl_Menu_Bar item colors
Here's a test - is this any better? If you send a message that uses characters from certain character sets in the message body. Messages that use character sets from the following code pages are encoded as Base64 messages when they are sent from an Exchange 2000 computer: Shift-JIS EUC-KR ISO-2202-JP BIG5 ISO-2202-KR GB18030 GB2312 Yup - though I don't use any CJK language normally, so I don't think that can be it. I do wonder if it is struggling with something else that is getting encoded as UTF-8 in my posts though? That might do it I guess, if it is 7-bit cleanness that is the issue here? This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Changing an Fl_Menu_Bar item colors
Thanks for the reply. This code works well for changing the text foreground color. However I also need to change the background color (the gray box behind the text). Any ideas how to change the background color in an Fl_Menu_Bar item? I don't think there is an easy fix for this (though hopefully others will know better!) but you might be able to make it so... The method that actually draws the menu items, Fl_Menu_Item::draw(...), is defined in Fl_Menu.cxx, so I guess it might be possible to derive your own Fl_Menu class (and maybe also Fl_Menu_Bar class and Fl_Menu_Item struct...) and then add in the ability to set the menu item background... Note that Fl_Menu_Item::draw(...) actually can cope with drawing different boxtypes and colours and so forth, but there's no way to ask for those features for regular menu items, it is meant for menu buttons and so forth... Though maybe you can do something with selection_color(); I wonder if that would work...? Um, probably not... Anyway; best bet is probably to hope that Sanel or someone knows a workaround for this! Cheers, -- Ian This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Changing an Fl_Menu_Bar item colors
Posts from Ian come up as a big block of letters in my browser. Is this some kind of compressed file or is there a problem somewhere? I use Opera on Ubuntu. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Changing an Fl_Menu_Bar item colors
On 31 Jan 2013, at 19:40, David Allen wrote: Posts from Ian come up as a big block of letters in my browser. Is this some kind of compressed file or is there a problem somewhere? I use Opera on Ubuntu. Urgh! I had not seen that, they get delivered here OK... But looking on the forum view, I see them as big blocks of what looks like Base64 or some such thing... Has this been happening for long? Did not used to happen... I'm posting those from Outlook at work and I have had some sensible looking replies, so I guess that at least some folk must be seeing them intact... Weird: I'll check tomorrow, see if my Outlook settings have been changed or something... ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Changing an Fl_Menu_Bar item colors
On 31 Jan 2013, at 19:40, David Allen wrote: Posts from Ian come up as a big block of letters in my browser. Is = this some kind of compressed file or is there a problem somewhere? I use = Opera on Ubuntu. Urgh! I had not seen that, they get delivered here OK... But looking on the forum view, I see them as big blocks of what looks = like Base64 or some such thing... Has this been happening for long? Did not used to happen... I'm posting those from Outlook at work and I have had some sensible = looking replies, so I guess that at least some folk must be seeing them = intact... Weird: I'll check tomorrow, see if my Outlook settings have been changed = or something... For what it is worth... I just fired a few of my trashed messages through a hack decoder I knocked up; and it is Base64 encoding as I suspected. Don't know why though. Looking back through the forum, it looks like my posts were OK in December, but since I went back to work in January, all my posts look to be b64 and not readily readable. So... I have to assume some setting has been improved by the clowns that run our IT services at work... I'll need to see if I can revert this - though there may be some noise whilst I test - apologies in advance! ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Changing an Fl_Menu_Bar item colors
For what it is worth... I just fired a few of my trashed messages through a hack decoder I knocked up; and it is Base64 encoding as I suspected. In the days of 7 bit ASCII base64 was a necessity today it is rank stupidity. So... I have to assume some setting has been improved by the clowns that run our IT services at work... I'll need to see if I can revert this - though there may be some noise whilst I test - apologies in advance! from http://support.microsoft.com/kb/323489 Base64 encoding in Exchange Server Base64 encoding is used in the following situations: If you send a message that contains characters that are outside the 7bit US-ASCII range. Exchange Server is a 7-bit Simple Mail Transfer Protocol (SMTP) transport. To send an 8-bit message, the message must be encoded in Base64, and then sent by using SMTP. [snip] May be your outlook (M$ outhouse) is sending in one of these char sets. If you send a message that uses characters from certain character sets in the message body. Messages that use character sets from the following code pages are encoded as Base64 messages when they are sent from an Exchange 2000 computer: Shift-JIS EUC-KR ISO-2202-JP BIG5 ISO-2202-KR GB18030 GB2312 ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Changing an Fl_Menu_Bar item colors
Thanks for the reply. This code works well for changing the text foreground color. However I also need to change the background color (the gray box behind the text). Any ideas how to change the background color in an Fl_Menu_Bar item? Thanks, Howard Rubin On 28 Jan 2013 05:37:11 -0800, Sanel Zukan wrote: First you need to assign callback to desired Fl_Menu_Item, whose colors you are going to change. From callback you can access Fl_Menu_Bar and by using mvalue() member, you can access to selected item; from there you can change label color, background and etc. Here is example: static void color_cb(Fl_Widget *w, void*) { Fl_Menu_Bar *bar = (Fl_Menu_Bar*)w; if(!bar-mvalue()) return; Fl_Menu_Item *self = (Fl_Menu_Item*)bar-mvalue(); self-labelcolor(FL_RED); } // your Fl_Menu_Item table: static Fl_Menu_Item table[] = { {File, 0,0,0,FL_SUBMENU}, {To red, 0, color_cb}, {0} }; Sanel On 01/23/2013 12:09 AM, Howard Rubin wrote: I have an Fl_Menu_Bar with a few added items that have the FL_MENU_TOGGLE property. This adds checkboxes to the menu. I need to change the visual indication that each menu item has been clicked from the checkbox to toggling menu item foreground (text) and background colors. Obviously I could eliminate the FL_MENU_TOGGLE property if that'd help. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Changing an Fl_Menu_Bar item colors
Hi, I had a similar requirement some time ago, so workaround like this helped me. There are hidden gems here and there... :) Sanel On 01/28/2013 03:10 PM, MacArthur, Ian (Selex ES, UK) wrote: Hi Sanel, That's neat - I didn’t know that worked! First you need to assign callback to desired Fl_Menu_Item, whose colors you are going to change. From callback you can access Fl_Menu_Bar and by using mvalue() member, you can access to selected item; from there you can change label color, background and etc. Here is example: static void color_cb(Fl_Widget *w, void*) { Fl_Menu_Bar *bar = (Fl_Menu_Bar*)w; if(!bar-mvalue()) return; Fl_Menu_Item *self = (Fl_Menu_Item*)bar-mvalue(); self-labelcolor(FL_RED); } // your Fl_Menu_Item table: static Fl_Menu_Item table[] = { {File, 0,0,0,FL_SUBMENU}, {To red, 0, color_cb}, {0} }; This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Changing an Fl_Menu_Bar item colors
Hi Sanel, That's neat - I didn’t know that worked! First you need to assign callback to desired Fl_Menu_Item, whose colors you are going to change. From callback you can access Fl_Menu_Bar and by using mvalue() member, you can access to selected item; from there you can change label color, background and etc. Here is example: static void color_cb(Fl_Widget *w, void*) { Fl_Menu_Bar *bar = (Fl_Menu_Bar*)w; if(!bar-mvalue()) return; Fl_Menu_Item *self = (Fl_Menu_Item*)bar-mvalue(); self-labelcolor(FL_RED); } // your Fl_Menu_Item table: static Fl_Menu_Item table[] = { {File, 0,0,0,FL_SUBMENU}, {To red, 0, color_cb}, {0} }; This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Changing an Fl_Menu_Bar item colors
I have an Fl_Menu_Bar with a few added items that have the FL_MENU_TOGGLE property. This adds checkboxes to the menu. I need to change the visual indication that each menu item has been clicked from the checkbox to toggling menu item foreground (text) and background colors. Obviously I could eliminate the FL_MENU_TOGGLE property if that'd help. I don't know... for historical reasons, the menu entries in the fltk-1.x menus aren't proper widgets in the usual fltk sense, so changing their behaviour and appearance is a pain. Though I think it can be - but I don't have any example code here; perhaps others have something? (I think fltk3, and indeed fltk2, are attempting to address that menu discrepancy and make menu items more normal so this problem might go away. Eventually...) This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
[fltk.general] Changing an Fl_Menu_Bar item colors
I have an Fl_Menu_Bar with a few added items that have the FL_MENU_TOGGLE property. This adds checkboxes to the menu. I need to change the visual indication that each menu item has been clicked from the checkbox to toggling menu item foreground (text) and background colors. Obviously I could eliminate the FL_MENU_TOGGLE property if that'd help. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk