PureCOLOR library : coloring gadgets (and much more)
Moderator: gnozal
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
Update v15.00 (PB 4.40 version)
Changes :
- split library in 3 parts (menus, buttons, the rest of the gadgets)
So you have a smaller footprint if you don't use all functions.
- new functions (user request) : PureCOLOR_SetIcon[Toggle]Button()
Changes :
- split library in 3 parts (menus, buttons, the rest of the gadgets)
So you have a smaller footprint if you don't use all functions.
- new functions (user request) : PureCOLOR_SetIcon[Toggle]Button()
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
Update v15.02 (PB 4.40 version)
Changes :
- fixed window icon menu / popup icon menu coexistence issue posted by iostream (finally)
Changes :
- fixed window icon menu / popup icon menu coexistence issue posted by iostream (finally)
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
- Rook Zimbabwe
- Addict
- Posts: 4326
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
Having issue clearing button colors... will try new DL and see if that is the fix!
Nope:
look...
This code SHOULD uncolor all the buttons and then slap the color on the selectted button... instead it simply colors the new button as well...
Using PureCOLOR_ClearAllButtonColors() is not an option in my program as I have MANY buttons in my POS... in PB4.3 this code works... I suspect it is a PB4.41 issue!
The latest version I could download fromyour site was 15.03
Nope:
look...
Code: Select all
Enumeration
#Window_0
EndEnumeration
Enumeration
#Button_8
#Button_7
#Button_6
#Button_5
#Button_4
#Button_3
#Button_2
#Button_1
#Button_0
#Text_MSG
EndEnumeration
Structure VisualDesignerGadgets
Gadget.l
EventFunction.l
EndStructure
Global NewList EventProcedures.VisualDesignerGadgets()
;-
Procedure Whichbutton(button)
For XX = #Button_8 To #Button_0
PureCOLOR_ClearButtonColor(XX)
Next
PureCOLOR_SetButtonColor(button, RGB(255, 255, 255), RGB(0, 0, 0))
EndProcedure
;-
Procedure Button_8_Event(Window, Event, Gadget, Type)
Whichbutton(#Button_8)
EndProcedure
Procedure Button_7_Event(Window, Event, Gadget, Type)
Whichbutton(#Button_7)
EndProcedure
Procedure Button_6_Event(Window, Event, Gadget, Type)
Whichbutton(#Button_6)
EndProcedure
Procedure Button_5_Event(Window, Event, Gadget, Type)
Whichbutton(#Button_5)
EndProcedure
Procedure Button_4_Event(Window, Event, Gadget, Type)
Whichbutton(#Button_4)
EndProcedure
Procedure Button_3_Event(Window, Event, Gadget, Type)
Whichbutton(#Button_3)
EndProcedure
Procedure Button_2_Event(Window, Event, Gadget, Type)
Whichbutton(#Button_2)
EndProcedure
Procedure Button_1_Event(Window, Event, Gadget, Type)
Whichbutton(#Button_1)
EndProcedure
Procedure Button_0_Event(Window, Event, Gadget, Type)
Whichbutton(#Button_0)
EndProcedure
;-
Procedure RegisterGadgetEvent(Gadget, *Function)
If IsGadget(Gadget)
AddElement(EventProcedures())
EventProcedures()\Gadget = Gadget
EventProcedures()\EventFunction = *Function
EndIf
EndProcedure
Procedure CallEventFunction(Window, Event, Gadget, Type)
ForEach EventProcedures()
If EventProcedures()\Gadget = Gadget
CallFunctionFast(EventProcedures()\EventFunction, Window, Event, Gadget, Type)
LastElement(EventProcedures())
EndIf
Next
EndProcedure
;-
Procedure Open_Window_0()
If OpenWindow(#Window_0, 5, 5, 248, 441, "BUTON TESTER", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
ButtonGadget(#Button_0, 5, 5, 235, 40, "BUTTON 0")
RegisterGadgetEvent(#Button_0, @Button_0_Event())
ButtonGadget(#Button_1, 5, 50, 235, 40, "BUTTON 1")
RegisterGadgetEvent(#Button_1, @Button_1_Event())
ButtonGadget(#Button_2, 5, 95, 235, 40, "BUTTON 2")
RegisterGadgetEvent(#Button_2, @Button_2_Event())
ButtonGadget(#Button_3, 5, 140, 235, 40, "BUTTON 3")
RegisterGadgetEvent(#Button_3, @Button_3_Event())
ButtonGadget(#Button_4, 5, 185, 235, 40, "BUTTON 4")
RegisterGadgetEvent(#Button_4, @Button_4_Event())
ButtonGadget(#Button_5, 5, 230, 235, 40, "BUTTON 5")
RegisterGadgetEvent(#Button_5, @Button_5_Event())
ButtonGadget(#Button_6, 5, 275, 235, 40, "BUTTON 6")
RegisterGadgetEvent(#Button_6, @Button_6_Event())
ButtonGadget(#Button_7, 5, 320, 235, 40, "BUTTON 7")
RegisterGadgetEvent(#Button_7, @Button_7_Event())
ButtonGadget(#Button_8, 5, 365, 235, 40, "BUTTON 8")
RegisterGadgetEvent(#Button_8, @Button_8_Event())
TextGadget(#Text_MSG, 5, 410, 235, 25, "", #PB_Text_Center | #PB_Text_Border)
EndIf
EndProcedure
;-
Open_Window_0()
PureCOLOR_SetButtonColor(#Button_0, RGB(255, 255, 255), RGB(0, 0, 0))
Repeat
Event = WaitWindowEvent()
Gadget = EventGadget()
Type = EventType()
Window = EventWindow()
Select Event
Case #PB_Event_Gadget
CallEventFunction(Window, Event, Gadget, Type)
EndSelect
Until Event = #PB_Event_CloseWindow
End
Using PureCOLOR_ClearAllButtonColors() is not an option in my program as I have MANY buttons in my POS... in PB4.3 this code works... I suspect it is a PB4.41 issue!
The latest version I could download fromyour site was 15.03
- DoubleDutch
- Addict
- Posts: 3219
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
On PureBasic v4.50b2 I get polink errors. They refer to unsolved external symbols 'pb_callfunctionfast', 'pb_callfunctionfast7' an 'pb_callfunctionfast4'.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- Rook Zimbabwe
- Addict
- Posts: 4326
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
OK with a little help from a tiny bit of code from eesau I have used the API to reset colors in a proceedure.
I changed the following procedure:
I am worried about memory leaks... I may try to set button text and face myself... Maybe even a rounded button! (Ala VB4!)
@DoubleDutch... LIB isn't optimizeed for 4.5 yet! I suspect the new draw functions are to blame for some of our issues!
I changed the following procedure:
Code: Select all
Procedure Whichbutton(button)
cbutface = GetSysColor_ ( #COLOR_BTNFACE ) ; API for theme button FACE color
cbuttext = GetSysColor_ ( #COLOR_BTNTEXT) ; API for theme button TEXT color
For XX = #Button_8 To #Button_0
;PureCOLOR_ClearButtonColor(XX)
PureCOLOR_SetButtonColor(XX, cbuttext, cbutface) ; use those raw values to recolor the button
Next
; PureCOLOR_ClearAllButtonColors()
PureCOLOR_SetButtonColor(button, RGB(255, 255, 255), RGB(0, 0, 0))
EndProcedure
@DoubleDutch... LIB isn't optimizeed for 4.5 yet! I suspect the new draw functions are to blame for some of our issues!
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
I will have a look.Rook Zimbabwe wrote:Having issue clearing button colors... will try new DL and see if that is the fix!
The latest version I could download from your site was 15.03
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
Update v15.04 (PB 4.40 version)
Changes :
- fixed cleared buttons not being refreshed (a global variable got lost when I split the library).
Changes :
- fixed cleared buttons not being refreshed (a global variable got lost when I split the library).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
- Rook Zimbabwe
- Addict
- Posts: 4326
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
So would my fix :
just create more images and clutter memory?
ALSO
You need to make a DONATION link on your website... I use PureCOLOR and I intend to pay you for it!!! I am probaly going to use pureFORM soon as I am becoming dissatisfied with the current VD!!! You need to make that a purchase thing... $10.00 or more!!!
Yrretti wrote you do a lot of good works for PB and I wholly agree!!!
Code: Select all
cbutface = GetSysColor_ ( #COLOR_BTNFACE )
cbuttext = GetSysColor_ ( #COLOR_BTNTEXT)
For XX = #Button_0 To #Button_8
PureCOLOR_ClearButtonColor(XX)
PureCOLOR_SetButtonColor(XX, cbuttext, cbutface)
Next
ALSO
You need to make a DONATION link on your website... I use PureCOLOR and I intend to pay you for it!!! I am probaly going to use pureFORM soon as I am becoming dissatisfied with the current VD!!! You need to make that a purchase thing... $10.00 or more!!!
Yrretti wrote you do a lot of good works for PB and I wholly agree!!!
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
No, PureCOLOR_ClearButtonColor() clears the allocated resources.Rook Zimbabwe wrote:So would my fix ... just create more images and clutter memory?
Anyway, a simple refresh (like RedrawWindow_()) would have been enough.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
I have have just recompiled the library for PB 4.50 beta 4
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureCOLOR library : coloring gadgets (and much more)
thank you! works fine with pb4.50 B4 nowgnozal wrote:I have have just recompiled the library for PB 4.50 beta 4
"Daddy, I'll run faster, then it is not so far..."
Re: PureCOLOR library : coloring gadgets (and much more)
I am using PureColor 4.5B4 and the Option Gadgets are not setting the Front Color.
PureColor_SetGadgetColor(#Option1, $FFFFFF, #Blue)
Sets the Background, but not the ForeGound(Text)
Thanks
PureColor_SetGadgetColor(#Option1, $FFFFFF, #Blue)
Sets the Background, but not the ForeGound(Text)
Thanks
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureCOLOR library : coloring gadgets (and much more)
This works here :rnospam wrote:I am using PureColor 4.5B4 and the Option Gadgets are not setting the Front Color.
PureColor_SetGadgetColor(#Option1, $FFFFFF, #Blue)
Sets the Background, but not the ForeGound(Text)
Thanks
Code: Select all
OpenWindow(0, 100, 300, 400, 200, "PureCOLOR test", #PB_Window_SystemMenu)
OptionGadget(1, 10, 10, 90, 20, "OptionGadget")
PureCOLOR_SetGadgetColor(1, RGB(255,0,0), RGB(0,0,255))
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureCOLOR library : coloring gadgets (and much more)
OpenWindow(0, 100, 300, 400, 200, "PureCOLOR test", #PB_Window_SystemMenu)
OptionGadget(1, 10, 10, 90, 20, "OptionGadget")
PureCOLOR_SetGadgetColor(1, RGB(255,0,0), RGB(0,0,255))
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Does not work, I am using Windows 7, 64Bit, PureBasic 4.5Beta4 32Bit. Aero Theme.
Text Color is always black.
Thanks..
Rnospam
OptionGadget(1, 10, 10, 90, 20, "OptionGadget")
PureCOLOR_SetGadgetColor(1, RGB(255,0,0), RGB(0,0,255))
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Does not work, I am using Windows 7, 64Bit, PureBasic 4.5Beta4 32Bit. Aero Theme.
Text Color is always black.
Thanks..
Rnospam
Re: PureCOLOR library : coloring gadgets (and much more)
Update.. Also Does not work with checkbox gadgets
PB 4.41 and PureColor Version 15.03 work great.
Rnospam
PB 4.41 and PureColor Version 15.03 work great.
Rnospam