Page 17 of 35

Posted: Mon Aug 21, 2006 1:15 pm
by gnozal
Update 12.22 (both libs)

- changed PanelGadget coloring method

Posted: Tue Aug 22, 2006 8:38 am
by magicjo
@gnozal, settings the colors for Frame3DGadget and OptionGadget don't work very well when xp theme is enabled: is possibile to do anything ?

Thanks in advance.

Posted: Tue Aug 22, 2006 10:41 am
by gnozal
magicjo wrote:@gnozal, settings the colors for Frame3DGadget and OptionGadget don't work very well when xp theme is enabled: is possibile to do anything ?
I fear not.
Because :
- I don't have XP to test (yet) ...
- M$ is not compliant with it's own specifications when it comes to XP themes (some API calls don't function correctly).

Posted: Thu Oct 19, 2006 10:38 am
by gnozal
Update (PB4 version only)

Changes :
- added unicode / unicode+threadsafe versions

Posted: Thu Oct 19, 2006 12:17 pm
by AND51
Yeha, I've waited for this feature!

But, how to instal and use the Lib? I wish, that I only have to enable "Compiler Threadsafe". I don't want to use the Subsystem things. Or do I have to?

Posted: Thu Oct 19, 2006 12:45 pm
by gnozal
AND51 wrote:But, how to instal and use the Lib?
PureCOLOR.chm wrote:This library exists in several versions :
- the standard version, located in %Purebasic%\PureLibraries\UserLibraries\ ;
- the thread-safe version, located in %Purebasic%\SubSystems\UserLibThreadSafe\PureLibraries\ .
- the unicode version, located in %Purebasic%\SubSystems\UserLibUnicode\PureLibraries\ .
- the unicode + thread-safe version, located in %Purebasic%\SubSystems\UserLibunicodeThreadSafe\PureLibraries\ .
In order to use this library in thread-safe mode (compiler option /THREAD), you have to enable the
subsystem 'UserLibThreadSafe' in the PB IDE, or add '/SUBSYSTEM UserLibThreadSafe' to the
PBCompiler arguments. In jaPBe, do nothing : it will automatically enable the 'UserLibThreadSafe'
subsystem to use the threadsafe versions of the installed userlibraries.
It's the same logic for unicode and unicode + thread-safe modes.
AND51 wrote:But, how to instal and use the Lib?. I don't want to use the Subsystem things. Or do I have to?
I you use jaPBe V3, you don't have to (it's automatic).
If you use the PBIDE, enable the subsystem you need : if you need threadsafe, add "UserLibThreadSafe" in the "Library Subsystem" stringgadget in the "Compiler Options" window.

Posted: Thu Oct 19, 2006 1:22 pm
by mskuma
gnozal wrote:- added unicode / unicode+threadsafe versions
Great - thanks alot!

Posted: Thu Oct 26, 2006 5:36 pm
by rsts
Scanned all 17 pages but maybe I missed it.

I have the latest lib.

PureColor doesn't work on a multiline button?

result = ButtonGadget(#MenuBar_0_SelectAll, 5, 435, 40, 40, "Select"+Chr(10)+" All",#PB_Button_MultiLine|#BS_FLAT)

Tried several variations on that theme but can't get it to work.

Fine without PureColor.

Is it me? Is it possible?

cheers

Posted: Fri Oct 27, 2006 7:42 am
by gnozal
rsts wrote:PureColor doesn't work on a multiline button?
You are right, multiline buttons are not supported. I don't use multiline buttons myself, so I never thought of supporting them.
I will see what I can do when I have some time.

Posted: Fri Oct 27, 2006 12:34 pm
by RichardL
BACKGROUND
=========
I have an array of buttons that double up as string gadgets that report values input via RS232.

The user can click once on a button and this becomes the target for data received from external hardware and I colour it to show the selected item. Then, if the external hardware sends a value it goes to the button, the button background colour is cleared and the text shown in RED.

If the user clicks twice then an editor pops up and he can enter data manually, the background is removed and the value is shown in BLUE.

After the end of the test you can see how many results were supplied automatically or manually.

This all works fine, thanks to your library, and the users like the ability to gain a quick appreciation of how a test sequence is progressing.

The only problem I have left is when the user clicks twice on a RED result, accidently goes into the editor, exits without editing (which I can detect) and I need to re-instate the original RED.

All my problems would go away if I could read back the colours from a button. I cannot think of a better solution... overall its quite a complex program and runs on a tablet PC and there are actually many more interactions than outlined above.

REQUEST
======
Please could PureCOLOR_SetButtonColor() be matched with PureCOLOR_GetButtonColor() ?

If not, could you kindly suggest a less elegant way of getting the colours set into a ButtonGadget().

Thanks in advance...

Posted: Fri Oct 27, 2006 2:54 pm
by gnozal
RichardL wrote:REQUEST
======
Please could PureCOLOR_SetButtonColor() be matched with PureCOLOR_GetButtonColor() ?
Ok, on the to-do list.

Posted: Mon Oct 30, 2006 5:33 pm
by gnozal
Update (Both versions)

Changes :
- new function PureCOLOR_GetGadgetColor() ;
- multiline buttons should now be colored correctly (note that PureCOLOR assumes that buttons with #BS_Multiline style are centered (no #BS_Left or #BS_Right style).

Posted: Mon Oct 30, 2006 6:54 pm
by rsts
very quick.

Thanks gnozal :)

cheers

Posted: Sun Jan 28, 2007 12:21 pm
by Inf0Byt3
Hi! I've got a problem with the menu coloring. When activation PureColor for the menu, the MenuItem resets. Maybe i'm missing something.
Here's a quick example that should debug 1,2,3,4,5,6,7,8, etc. But it only debugs from 1 to 3...

Code: Select all

If OpenWindow(0, 10, 10, 300, 200, "Ownerdraw Menu Demo", #PB_Window_ScreenCentered | #PB_Window_SystemMenu) 
  If CreateMenu(0, WindowID(0)) 
    MenuTitle("Menu 1") 
    MenuItem(1, "Menu item 1") 
    MenuItem(2, "Menu item 2") 
    MenuItem(3, "Menu item 3") 
    MenuItem(4, "Exit") 
    MenuTitle("Menu 2") 
    MenuItem(5, "Menu item 1") 
    MenuItem(6, "Menu item 2 (longer)")
    MenuItem(7, "Menu item 3")
    MenuTitle("Extra menu") 
    MenuItem(8, "Extra long menu item") 
    OpenSubMenu("The level 1 submenu")
    MenuItem(9, "The pure power !") 
    OpenSubMenu("The level 2 submenu")
    MenuItem(10, "What ?") 
    MenuItem(11, "Hello ...") 
    CloseSubMenu()
    CloseSubMenu()
  EndIf
  ;
  ; MENU COLORS
  ; -------------
  ; Owner drawn :
  ; -------------
  PureCOLOR_SetMenuColors(0, #Red, RGB(200, 255, 200), #Red, RGB(100, 255, 100))
  PureCOLOR_SetWindowColor(0, RGB(200, 255, 200))
  ; -------------
  ; or not (but then only backcolor) : 
  ; -------------
  ;PureCOLOR_SetPopupMenuBackColor(0, RGB(200, 255, 200))
  ; -------------
  Repeat 
    event = WaitWindowEvent() 
    If event = #PB_Event_Menu
     Debug EventMenu()
    EndIf
  Until event = #PB_Event_CloseWindow 
EndIf
End


Posted: Mon Jan 29, 2007 8:59 am
by gnozal
Inf0Byt3 wrote:Hi! I've got a problem with the menu coloring. When activation PureColor for the menu, the MenuItem resets. Maybe i'm missing something.
Here's a quick example that should debug 1,2,3,4,5,6,7,8, etc. But it only debugs from 1 to 3...
As stated in the help file, PureCOLOR uses it's own menu numbering (see help topics for PureCOLOR_SetMenuItemColors() and PureCOLOR_EventMenuID()). To get the correct event menu id, you have to use PureCOLOR_EventMenuID(). Sorry for this inconvenience.

Code: Select all

If OpenWindow(0, 10, 10, 300, 200, "Ownerdraw Menu Demo", #PB_Window_ScreenCentered | #PB_Window_SystemMenu) 
  If CreateMenu(0, WindowID(0)) 
    MenuTitle("Menu 1") 
    MenuItem(1, "Menu item 1") 
    MenuItem(2, "Menu item 2") 
    MenuItem(3, "Menu item 3") 
    MenuItem(4, "Exit") 
    MenuTitle("Menu 2") 
    MenuItem(5, "Menu item 1") 
    MenuItem(6, "Menu item 2 (longer)") 
    MenuItem(7, "Menu item 3") 
    MenuTitle("Extra menu") 
    MenuItem(8, "Extra long menu item") 
    OpenSubMenu("The level 1 submenu") 
    MenuItem(9, "The pure power !") 
    OpenSubMenu("The level 2 submenu") 
    MenuItem(10, "What ?") 
    MenuItem(11, "Hello ...") 
    CloseSubMenu() 
    CloseSubMenu() 
  EndIf 
  ; 
  ; MENU COLORS 
  ; ------------- 
  ; Owner drawn : 
  ; ------------- 
  PureCOLOR_SetMenuColors(0, #Red, RGB(200, 255, 200), #Red, RGB(100, 255, 100)) 
  PureCOLOR_SetWindowColor(0, RGB(200, 255, 200)) 
  ; ------------- 
  ; or not (but then only backcolor) : 
  ; ------------- 
  ;PureCOLOR_SetPopupMenuBackColor(0, RGB(200, 255, 200)) 
  ; ------------- 
  Repeat 
    event = WaitWindowEvent() 
    If event = #PB_Event_Menu 
      Debug EventMenu() 
      Debug PureCOLOR_EventMenuID()
    EndIf 
  Until event = #PB_Event_CloseWindow 
EndIf 
End