Page 29 of 35

Posted: Fri Jun 26, 2009 10:52 pm
by DoubleDutch
Thanks for advertising
:lol:

Posted: Mon Aug 17, 2009 2:20 pm
by gnozal
New version compiled with PB4.40 beta 1 : http://freenet-homepage.de/gnozal/PureCOLOR_440.zip

Posted: Mon Aug 17, 2009 5:47 pm
by magicjo
@gnozal,
if i compile in threadsafe mode the example module "PUREColor_Test.pb", i obtain the error "unresolved external symbol _PBStringBasePosition" : can you verify ?

Posted: Mon Aug 17, 2009 8:33 pm
by Kurzer
Did you set the Subsystem "UserLibThreadSafe" in the compiler-prefs?
I stumbled over the same issue after enabling the threadsafe-mode in the compiler options.

Posted: Mon Aug 17, 2009 8:40 pm
by magicjo
thanks kurzer.
I usually use Japbe and there's not need to set the subsystem. :wink:

Problem with PureCOLOR

Posted: Sat Jan 02, 2010 3:27 pm
by superloupiot
Hi,

I'm new to the use of PureBasic (3 days ago).
I've started to use it and quiclky came to the point where I would like to change the background color a the button gadget.

Apparently, the PureCOLOR library authorizes that feature.
Hence, I have installed the PureCOLOR library version 4.4.
When I try to compile the example code PureCOLOR_Test.pb, I get the following error message:

POLINK:fatal error: Corrupt library:.\PureCOLOR_Lib_14.lib

I'm working under Windows7 - 64 bit.
The version of PureBasic is 4.40 (x64)
The version of PureCOLOR is 4.40 : PureCOLOR_440.zip

Could some one help me here?

Thanks.

Re: Problem with PureCOLOR

Posted: Sat Jan 02, 2010 4:31 pm
by superloupiot
OK, I have remove the 64-bit version of PureBasic and installed the32-bit version.
I can observe that on my computer, PureCOLOR work with the 32-bit version but not with the 64-bit version.

Button gadget and multiline flag

Posted: Sat Jan 02, 2010 5:37 pm
by superloupiot
Hello,

When the Button_MultiLine flag is set and when a PureColor is applied to the button gadget, the background color is as expected but the text background color is white.

Is there a way to change the text background color to the same color as the button background color.

Here after is the code that shows the problem.

Thanks.
  • ;{- Enumerations / DataSections
    ;{ Windows
    Enumeration
    #Window_0
    EndEnumeration
    ;}
    ;{ Gadgets
    Enumeration
    #Button_0
    EndEnumeration
    ;}
    Define.l Event, EventWindow, EventGadget, EventType, EventMenu
    ;}
    Procedure OpenWindow_Window_0()
    If OpenWindow(#Window_0, 450, 200, 400, 400, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    ButtonGadget(#Button_0, 100, 75, 160, 135, "Gadget_0", #PB_Button_MultiLine)
    ; Gadget Colors
    PureCOLOR_SetButtonColor(#Button_0, #PureCOLOR_SystemColor, $FF, #PureCOLOR_SystemColor, $8080FF)
    EndIf
    EndProcedure

    OpenWindow_Window_0()

    ;{- Event loop
    Repeat
    Event = WaitWindowEvent()
    Select Event
    ; ///////////////////
    Case #PB_Event_Gadget
    EventGadget = EventGadget()
    EventType = EventType()
    If EventGadget = #Button_0
    EndIf
    ; ////////////////////////
    Case #PB_Event_CloseWindow
    EventWindow = EventWindow()
    If EventWindow = #Window_0
    CloseWindow(#Window_0)
    Break
    EndIf
    EndSelect
    Forever
    ;
    ;}

Re: Problem with PureCOLOR

Posted: Tue Jan 05, 2010 3:20 pm
by gnozal
superloupiot wrote:OK, I have remove the 64-bit version of PureBasic and installed the32-bit version.
I can observe that on my computer, PureCOLOR work with the 32-bit version but not with the 64-bit version.
Yes, all my apps / libs / tools are 32bits (x86) only.

Re: Button gadget and multiline flag

Posted: Tue Jan 05, 2010 4:06 pm
by gnozal
Congratulations !
You found a bug.
I am using API functions for multiline buttons, and these functions and PB's '2DDrawing' library don't mix well since PB4.40.

Re: PureCOLOR library : coloring gadgets (and much more)

Posted: Tue Jan 05, 2010 4:09 pm
by gnozal
Update v14.06 (PB4.40 version)

Changes :
- this build should fix the multiline button issue posted by superloupiot

Re: PureCOLOR library : coloring gadgets (and much more)

Posted: Thu Jan 07, 2010 1:34 pm
by mx101
hi gnozal

if you can help me.
how to set SystemColor color to Frame3DGadget like PureColor without use the PureColor Lib?


i use x64 and PureColor not support x64.

Re: PureCOLOR library : coloring gadgets (and much more)

Posted: Thu Jan 07, 2010 3:41 pm
by gnozal
To set colors without PureCOLOR, this should work I guess (tested on XP x86 (themes disabled)) :

Code: Select all

Global textBackground = CreateSolidBrush_(#red)
Global textForeground = #White

Procedure WinProc(hwnd,msg,wParam,lParam) 
  result = #PB_ProcessPureBasicEvents 
  If msg=#WM_CTLCOLORSTATIC And lParam=GadgetID(1) 
    SetBkMode_(wParam, #TRANSPARENT) 
    SetTextColor_(wParam, textForeground)
    result = textBackground 
  EndIf 
  ProcedureReturn result 
EndProcedure 

OpenWindow(0,0,0,200,100,"Frame3DGadget Color",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
Frame3DGadget(1,20,20,150,70,"Some text") 
SetWindowCallback(@WinProc()) 

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow 

DeleteObject_(textBackground)
Some other code : http://www.purebasic.fr/english/viewtopic.php?t=24919

Re: PureCOLOR library : coloring gadgets (and much more)

Posted: Thu Jan 07, 2010 4:05 pm
by mx101
gnozal wrote:To set colors without PureCOLOR, this should work I guess (tested on XP x86 (themes disabled)) :

Code: Select all

Global textBackground = CreateSolidBrush_(#red)
Global textForeground = #White

Procedure WinProc(hwnd,msg,wParam,lParam) 
  result = #PB_ProcessPureBasicEvents 
  If msg=#WM_CTLCOLORSTATIC And lParam=GadgetID(1) 
    SetBkMode_(wParam, #TRANSPARENT) 
    SetTextColor_(wParam, textForeground)
    result = textBackground 
  EndIf 
  ProcedureReturn result 
EndProcedure 

OpenWindow(0,0,0,200,100,"Frame3DGadget Color",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
Frame3DGadget(1,20,20,150,70,"Some text") 
SetWindowCallback(@WinProc()) 

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow 

DeleteObject_(textBackground)
Some other code : http://www.purebasic.fr/english/viewtopic.php?t=24919
Big thanks gnozal :D

Re: PureCOLOR library : coloring gadgets (and much more)

Posted: Wed Jan 20, 2010 11:37 pm
by Kurzer
Aloha Gnozal,

I found a strange bug using PureColor and font-enabling for gadgets.
Try this code please:
(PB 4.40 final, PureColour 4.40, downloaded today)

Code: Select all

  Window_Main = OpenWindow(#PB_Any, 200, 200, 300, 60, "Test", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_TitleBar|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget)
  If Window_Main
    SmartWindowRefresh(Window_Main, #True)
    
    TestButton1 = ButtonGadget(#PB_Any, 10, 10, 135, 40, "Long long long text", #PB_Button_MultiLine)
    TestButton2 = ButtonGadget(#PB_Any, 155, 10, 140, 40, "Long long long text", #PB_Button_MultiLine)

    PureRESIZE_SetGadgetResize(TestButton1, 1, 0, 0, 1)
    PureRESIZE_SetGadgetResize(TestButton2, 1, 0, 0, 1)

    SetGadgetFont(TestButton1, LoadFont(0, "Arial", 8, 272))
    SetGadgetFont(TestButton2, LoadFont(1, "Arial", 8, 272))

    PureCOLOR_SetButtonColor(TestButton1, #PureCOLOR_SystemColor, $18A784)
    PureCOLOR_SetButtonColor(TestButton2, #PureCOLOR_SystemColor, $20B3B7)
  EndIf

	DisableGadget(TestButton1, 1)
	DisableGadget(TestButton2, 1)

	Repeat
	
		Delay (10)
		i+1
		
		If i = 100
			DisableGadget(TestButton1, 0)
			DisableGadget(TestButton2, 0)
		ElseIf i = 200
			DisableGadget(TestButton1, 1)
			DisableGadget(TestButton2, 1)
			i=0
		EndIf
	  
	Until WindowEvent() = #PB_Event_CloseWindow
I wannt to colour the buttons background and set a bold font for the button text.
All went okay. but if I disable and re-enable the buttons then a wrong fontsize/font will be displayed.

As you can see in the example above, in disabled mode the fontsize is correct. but after enabling the buttons the size is too big.

The code is extracted from a PureForm generated code, so no "manual" coding in the example except of some minor adjustments. If it's a logicallly failure, then PureFORM generate wrong code I guess.

Can you help me quickly with this problem? My current development/release stops because of this issue.

Thank you very much in advance.

Edit: It's not a PureBasic bug, because if you comment out the two PureCOLOR lines, then the bug does not appear.

Code: Select all

;     PureCOLOR_SetButtonColor(TestButton1, #PureCOLOR_SystemColor, $18A784)
;     PureCOLOR_SetButtonColor(TestButton2, #PureCOLOR_SystemColor, $20B3B7)