PureCOLOR library : coloring gadgets (and much more)

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

User avatar
GG
Enthusiast
Enthusiast
Posts: 266
Joined: Tue Jul 26, 2005 12:02 pm
Location: Lieusaint (77), France

Post by GG »

gnozal wrote:
GG wrote:Absolutely, but I would like to retrieve the PureColor version in my own program .
Ok, I understand
Any news about this ?
Purebasic 6.12 64 bits - Windows 11 Pro 64 bits 23H2
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

GG wrote:
gnozal wrote:
GG wrote:Absolutely, but I would like to retrieve the PureColor version in my own program .
Ok, I understand
Any news about this ?
Nope ... I am very busy lately ... not critical, is it ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
GG
Enthusiast
Enthusiast
Posts: 266
Joined: Tue Jul 26, 2005 12:02 pm
Location: Lieusaint (77), France

Post by GG »

gnozal wrote:
GG wrote:
gnozal wrote:
GG wrote:Absolutely, but I would like to retrieve the PureColor version in my own program .
Ok, I understand
Any news about this ?
Nope ... I am very busy lately ... not critical, is it ?
No problem, I can wait :D
Purebasic 6.12 64 bits - Windows 11 Pro 64 bits 23H2
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update (all versions)

Changes :
- (re)added function PureCOLOR_SetPopupMenuBackColor()
- new function PureCOLOR_Version()
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
GG
Enthusiast
Enthusiast
Posts: 266
Joined: Tue Jul 26, 2005 12:02 pm
Location: Lieusaint (77), France

Post by GG »

Thank you so much gnozal !

I will use and test this new function next year !
Purebasic 6.12 64 bits - Windows 11 Pro 64 bits 23H2
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

I've seen this in the forum for a while now but never really gave it a good try. Today (while recovering from the New Years eve party) decided to finally give it a good try...all I can say is WoW! I love it. Thank You :)
User avatar
GG
Enthusiast
Enthusiast
Posts: 266
Joined: Tue Jul 26, 2005 12:02 pm
Location: Lieusaint (77), France

Post by GG »

gnozal wrote:Update (all versions)

Changes :
- new function PureCOLOR_Version()
It works very well, thank you very much !
Purebasic 6.12 64 bits - Windows 11 Pro 64 bits 23H2
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update

Changes :
- new functions PureCOLOR_ActivateColoredPopUpMenu() and PureCOLOR_SetPopUpOfficeStyle() for ownerdrawn popup menus.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Post by Marco2007 »

Hi Gnozals,

first of all: Thanx For all your great libs :D !!

I have just one small problem: My menuitems are getting their text from a database. If setting the text with SetMenuItemText-> the whole background gets painted.
Is that normal?

Code: Select all

Enumeration
  #Window
EndEnumeration

Enumeration
  #MenuBar
EndEnumeration

Enumeration
  #menu_Liste1
  #menu_Liste2
  #menu_Liste3
  #menu_Liste4
  #menu_Liste5
  #menu_Liste6
  #menu_Liste7
  #menu_Liste8
  #menu_Liste9
  #menu_Liste10
  #menu_Liste11
  #menu_Liste12
  #menu_Liste13
  #menu_Liste14
  #menu_Liste15
  #MENU_Liste16
  #MENU_Liste17
EndEnumeration


Procedure Open_Window()
  If OpenWindow(#Window, -1, -1, 1280, 740, "Sapcontrol Extendend-Version",  #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar )
    If CreateMenu(#MenuBar, WindowID(#Window))
      MenuTitle("Menu")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste1, "hello")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste2, "Gnozal")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste3, "your libs")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste4, "are")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste5, "great")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste6, "")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste7, "")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste8, "")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste9, "")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste10, "")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste11, "")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste12, "")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste13, "")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste14, "")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste15, "")
      MenuTitle("Menu")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste16, "thank you")
      PureCOLOR_MenuItem(#MenuBar,#MENU_Liste17, "very much")
      PureCOLOR_ActivateColoredMenu(#menuBar)
      PureCOLOR_SetPopupMenuBackColor(#menuBar, #Blue)
      EndIf

      EndIf
EndProcedure

Open_Window() 
SetMenuItemText(#MenuBar,#MENU_Liste1, "Hi")
SetMenuItemText(#MenuBar,#MENU_Liste3, "your libs")
SetMenuItemText(#MenuBar,#MENU_Liste5, "excellent")
SetMenuItemText(#MenuBar,#MENU_Liste7, "thanx")

Repeat 

  Event = WaitWindowEvent() 

Until Event = #PB_Event_CloseWindow  
thanx
Marco

PureCOLOR_SetOfficeStyle(#menuBar)..also loses the effect with SetMenuItemText...
PureBasic for Windows
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Marco2007 wrote:I have just one small problem: My menuitems are getting their text from a database. If setting the text with SetMenuItemText-> the whole background gets painted.
Is that normal?
SetMenuItemText() is not compatible with PureCOLOR's owner drawn menus. I guess I will have to think about a new PureCOLOR_SetMenuItemText() function ...
Anyway, you could use something like this :

Code: Select all

Enumeration 
  #Window 
EndEnumeration 

Enumeration 
  #MenuBar 
EndEnumeration 

Enumeration 
  #menu_Liste1 
  #menu_Liste2 
  #menu_Liste3 
  #menu_Liste4 
  #menu_Liste5 
  #menu_Liste6 
  #menu_Liste7 
  #menu_Liste8 
  #menu_Liste9 
  #menu_Liste10 
  #menu_Liste11 
  #menu_Liste12 
  #menu_Liste13 
  #menu_Liste14 
  #menu_Liste15 
  #MENU_Liste16 
  #MENU_Liste17 
EndEnumeration 


Global Dim MyMenuItems.s(#PB_Compiler_EnumerationValue -1)
MyMenuItems(#menu_Liste1) = "hello"
MyMenuItems(#menu_Liste2) = "Gnozal"
MyMenuItems(#menu_Liste3) = "your libs"
MyMenuItems(#menu_Liste4) =  "are" 
MyMenuItems(#menu_Liste5) =  "great" 
MyMenuItems(#menu_Liste6) =  "" 
MyMenuItems(#menu_Liste7) =  "" 
MyMenuItems(#menu_Liste8) =  "" 
MyMenuItems(#menu_Liste9) =  "" 
MyMenuItems(#menu_Liste10) =  "" 
MyMenuItems(#menu_Liste11) =  "" 
MyMenuItems(#menu_Liste12) =  "" 
MyMenuItems(#menu_Liste13) =  "" 
MyMenuItems(#menu_Liste14) =  "" 
MyMenuItems(#menu_Liste15) =  "" 
MyMenuItems(#MENU_Liste16) =  "thank you" 
MyMenuItems(#MENU_Liste17) =  "very much" 

Procedure CreateMyMenu()
  If IsMenu(#MenuBar)
    FreeMenu(#MenuBar)
  EndIf
  If CreateMenu(#MenuBar, WindowID(#Window))
    MenuTitle("Menu") 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste1, MyMenuItems(#menu_Liste1)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste2, MyMenuItems(#menu_Liste2)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste3, MyMenuItems(#menu_Liste3)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste4, MyMenuItems(#menu_Liste4)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste5, MyMenuItems(#menu_Liste5)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste6, MyMenuItems(#menu_Liste6)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste7, MyMenuItems(#menu_Liste7)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste8, MyMenuItems(#menu_Liste8)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste9, MyMenuItems(#menu_Liste9)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste10, MyMenuItems(#menu_Liste10)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste11, MyMenuItems(#menu_Liste11)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste12, MyMenuItems(#menu_Liste12)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste13, MyMenuItems(#menu_Liste13)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste14, MyMenuItems(#menu_Liste14)) 
    PureCOLOR_MenuItem(#MenuBar,#menu_Liste15, MyMenuItems(#menu_Liste15)) 
    MenuTitle("Menu") 
    PureCOLOR_MenuItem(#MenuBar,#MENU_Liste16, MyMenuItems(#MENU_Liste16)) 
    PureCOLOR_MenuItem(#MenuBar,#MENU_Liste17, MyMenuItems(#MENU_Liste17)) 
    PureCOLOR_ActivateColoredMenu(#MenuBar) 
    PureCOLOR_SetOfficeStyle(#MenuBar) 
  EndIf
EndProcedure


Procedure Open_Window() 
  If OpenWindow(#Window, -1, -1, 1280, 740, "Sapcontrol Extendend-Version",  #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar ) 
    CreateMyMenu()
  EndIf 
EndProcedure 

Open_Window() 

MyMenuItems(#menu_Liste1) = "Hi"
MyMenuItems(#menu_Liste3) = "your libs"
MyMenuItems(#menu_Liste5) = "excellent" 
MyMenuItems(#menu_Liste7) = "thanx"
CreateMyMenu()

Repeat 
  
  Event = WaitWindowEvent() 
  
Until Event = #PB_Event_CloseWindow 
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Post by Marco2007 »

Thank you very much, genius!!!

PureColor_SetmenuitemText would be great :D
Last edited by Marco2007 on Fri Jan 11, 2008 4:43 pm, edited 1 time in total.
PureBasic for Windows
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update (all versions) [V13.41]

Changes :
- new function PureCOLOR_SetMenuItemText()
< EDIT >
- new function PureCOLOR_GetMenuItemText()
Last edited by gnozal on Sat Jan 12, 2008 9:14 am, edited 1 time in total.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Post by Marco2007 »

You´re killing me!!

EXCELLENT!!!

THANK YOU VERY MUCH!!!
PureBasic for Windows
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

See how this ComboBox is disabled, am I supposed to see Red? Is this a bug?
Am I supposed to set #Red to #PureCOLOR_SystemColor when I disable it?
Should this not be done automatically?

[Edit] And if you remove the #PB_ComboBox_Editable flag, the entire gadget
stays red even though it's disabled, which is wrong. It must become greyed.

Image

Code: Select all

OpenWindow( 0, 200,400,200,100, "", #PB_Window_SystemMenu)

CreateGadgetList( WindowID(0) )
ComboBoxGadget( 1, 10, 10, 180, 120, #PB_ComboBox_Editable )

  AddGadgetItem(1, -1, "123" )
  AddGadgetItem(1, -1, "456" )
  AddGadgetItem(1, -1, "789" )
  SetGadgetState(1,0)

  PureCOLOR_SetGadgetColor(1, #PureCOLOR_SystemColor, #Red)

  DisableGadget(1, #True)

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

PB wrote:See how this ComboBox is disabled, am I supposed to see Red? Is this a bug?
PureCOLOR doesn't check enabled/disabled status.
PB wrote:Am I supposed to set #Red to #PureCOLOR_SystemColor when I disable it?
Or use PureCOLOR_ClearGadgetColor()
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply