SetGadgetColor & StringGadget: Win7 or PB-Problem?

Windows specific forum
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

SetGadgetColor & StringGadget: Win7 or PB-Problem?

Post by Marco2007 »

Hi,

when I color a StringGadget on Win7, it looks like this (I don`t like the white thick Lines):
Image

XP:
Image
Sorry, if this has already been reported/discussed....
PureBasic for Windows
User avatar
Arctic Fox
Enthusiast
Enthusiast
Posts: 609
Joined: Sun Dec 21, 2008 5:02 pm
Location: Aarhus, Denmark

Re: SetGadgetColor & StringGadget: Win7 or PB-Problem?

Post by Arctic Fox »

I think it is caused by the border of the StringGadget.

Try this to create an XP-like border

Code: Select all

StringGadget(0, 5, 5, 100, 20, "StringGadget", #PB_String_BorderLess | #WS_BORDER)
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Re: SetGadgetColor & StringGadget: Win7 or PB-Problem?

Post by Marco2007 »

Excellent, but the PB-Team always says, we shouldn`t mix PB- and WinApi-constants or use Winapi-constants with PB-functions iirc.
It´s not centered correctly, but I think, there will be a flag for that...
Thx :D
PureBasic for Windows
Fred
Administrator
Administrator
Posts: 18360
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: SetGadgetColor & StringGadget: Win7 or PB-Problem?

Post by Fred »

You can, but it's not officially supported if something breaks later.
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Re: SetGadgetColor & StringGadget: Win7 or PB-Problem?

Post by Marco2007 »

Ok, thx, too! :D

Could do something native?
PureBasic for Windows
User avatar
Arctic Fox
Enthusiast
Enthusiast
Posts: 609
Joined: Sun Dec 21, 2008 5:02 pm
Location: Aarhus, Denmark

Re: SetGadgetColor & StringGadget: Win7 or PB-Problem?

Post by Arctic Fox »

Marco2007 wrote:It´s not centered correctly, but I think, there will be a flag for that...
Not centered correctly?
User avatar
Arctic Fox
Enthusiast
Enthusiast
Posts: 609
Joined: Sun Dec 21, 2008 5:02 pm
Location: Aarhus, Denmark

Re: SetGadgetColor & StringGadget: Win7 or PB-Problem?

Post by Arctic Fox »

Marco2007 wrote:Could do something native?
A rather 'quick' way :wink:

Code: Select all

OpenWindow(0, 100, 100, 300, 300, "")

ContainerGadget(0, 5, 5, 100, 20, #PB_Container_Flat)
StringGadget(1, 2, 2, 98, 18, "StringGadget", #PB_String_BorderLess)
CloseGadgetList()

SetWindowColor(0, #Green)
SetGadgetColor(0, #PB_Gadget_BackColor, #Green)
SetGadgetColor(1, #PB_Gadget_BackColor, #Green)

Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
End
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Re: SetGadgetColor & StringGadget: Win7 or PB-Problem?

Post by Marco2007 »

very clever :!:
Left one: #PB_String_BorderLess | #WS_BORDER (a little´bit too high)
Image
PureBasic for Windows
LuaDev
User
User
Posts: 33
Joined: Tue Feb 16, 2010 2:41 pm

Re: SetGadgetColor & StringGadget: Win7 or PB-Problem?

Post by LuaDev »

the under-estimated container gadget is one of my best friends, i like to house gadgets inside them and tweak the life out of it, adding message bars to listicons, search boxes and such and add it as a custom gadget

this little string trick tho, i never thought of that
Post Reply