Hello guys.
How can I set StatusBar background color as window color?
PureBasic do not has any command for status bar color changing.
Please provide small and simple example if possible.
I am not programmer and use this compiler for small hamradio programs.
Best Wishes.
StatusBar background color.
-
- Enthusiast
- Posts: 125
- Joined: Wed May 20, 2020 5:19 pm
- Location: The 3rd planet in the Solar System
- Contact:
StatusBar background color.
Mac Studio M1Max, PB 6.03Arm64 and x64.
Macbook Air M2, PB 6.03Arm64 and x64.
Windows 10, PB 6.03 x64 and x86.
Macbook Air M2, PB 6.03Arm64 and x64.
Windows 10, PB 6.03 x64 and x86.
Re: StatusBar background color.
Search for ts-soft example using canvas gadget statusbar. You get way more flexibility and control.
Do not try the statusbar direct approach since it will be more complicated with os specific callbacks and subclassing and api cmd's.
Do not try the statusbar direct approach since it will be more complicated with os specific callbacks and subclassing and api cmd's.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
-
- Enthusiast
- Posts: 125
- Joined: Wed May 20, 2020 5:19 pm
- Location: The 3rd planet in the Solar System
- Contact:
Re: StatusBar background color.
Tnx for answer.
ts-soft ???
Maybe mk-soft?
Anyway, do not find any example
Give me link if U have.
Thank U
ts-soft ???
Maybe mk-soft?
Anyway, do not find any example
Give me link if U have.
Thank U
Mac Studio M1Max, PB 6.03Arm64 and x64.
Macbook Air M2, PB 6.03Arm64 and x64.
Windows 10, PB 6.03 x64 and x86.
Macbook Air M2, PB 6.03Arm64 and x64.
Windows 10, PB 6.03 x64 and x86.
Re: StatusBar background color.
@dibor,
Thorsten1867 has designed a canvas version. I haven't used it myself, but I have used a few of his other canvas-based gadgets and found them very useful, to me!
Please take a look at the following link: viewtopic.php?p=534381#p534381
Thorsten1867 has designed a canvas version. I haven't used it myself, but I have used a few of his other canvas-based gadgets and found them very useful, to me!
Please take a look at the following link: viewtopic.php?p=534381#p534381
DE AA EB
Re: StatusBar background color.
This was posted way back when for Windows...
Code: Select all
; Title: Custom Statusbar Text Colors
; Author: Fluid Byte/RASHAD
; Date: December 28, 2006
Structure ODSBTEXT
szText.s
clrFront.i
hBrush.i
EndStructure
Global Result
Global Dim osbt.ODSBTEXT(5)
Procedure WindowCallback(hWnd,uMsg,wParam,lParam)
Select uMsg
Case #WM_DRAWITEM
If wParam = GetDlgCtrlID_(Result)
*lpdis.DRAWITEMSTRUCT = lParam
*osbt.ODSBTEXT = *lpdis\itemData
SetTextColor_(*lpdis\hDC, *osbt\clrFront)
SetBkMode_(*lpdis\hDC, #TRANSPARENT)
FillRect_(*lpdis\hDC, *lpdis\rcItem, *osbt\hBrush)
DrawText_(*lpdis\hDC, *osbt\szText, -1, *lpdis\rcItem, #DT_SINGLELINE | #DT_VCENTER | #DT_RIGHT)
EndIf
EndSelect
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
Procedure myStatusBarText(Field, Text.s, fCol, bCol)
Text+" "
osbt(Field)\szText = Text
osbt(Field)\clrFront = fCol
osbt(Field)\hBrush = CreateSolidBrush_(bCol)
SendMessage_(Result,#SB_SETTEXT, Field | #SBT_OWNERDRAW, osbt(Field))
EndProcedure
OpenWindow(0,0,0,350,100,"Custom Statusbar Text Colors",#WS_OVERLAPPEDWINDOW | 1)
SetWindowCallback(@WindowCallback())
Result = CreateStatusBar(0,WindowID(0))
AddStatusBarField(100)
AddStatusBarField(100)
AddStatusBarField(900)
SendMessage_(Result, #SB_SETMINHEIGHT, 40, 0)
SendMessage_(Result, #WM_SIZE, 0,0)
Text.s="1"
Field=0
fCol.l=#Green
bCol.l=#Gray
myStatusBarText(Field, Text, fCol, bCol)
Text.s="2"
Field=1
fCol.l=#Yellow
bCol.l=#Blue
myStatusBarText(Field, Text, fCol, bCol)
Text.s="3"
Field=2
fCol.l=#Red
bCol.l=#Yellow
myStatusBarText(Field, Text, fCol, bCol)
While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend
-
- Enthusiast
- Posts: 125
- Joined: Wed May 20, 2020 5:19 pm
- Location: The 3rd planet in the Solar System
- Contact:
Re: StatusBar background color.
Tnx davido and Paul!
Will try to use Thorsten module because I do not understand windows API at all.
Best Wishes!
Will try to use Thorsten module because I do not understand windows API at all.
Best Wishes!
Mac Studio M1Max, PB 6.03Arm64 and x64.
Macbook Air M2, PB 6.03Arm64 and x64.
Windows 10, PB 6.03 x64 and x86.
Macbook Air M2, PB 6.03Arm64 and x64.
Windows 10, PB 6.03 x64 and x86.
Re: StatusBar background color.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
-
- Enthusiast
- Posts: 125
- Joined: Wed May 20, 2020 5:19 pm
- Location: The 3rd planet in the Solar System
- Contact:
Re: StatusBar background color.
Hello.
Thorsten Hoeppner module looks good and has many options.
His example also runs as should, but when I try to implement this module in my program - I got status bar but in wrong location.
Looks like wrong window size determination, only with statusbar height 48 I can see text.
Will try to understand where and what I did wrong.
Thorsten Hoeppner module looks good and has many options.
His example also runs as should, but when I try to implement this module in my program - I got status bar but in wrong location.
Looks like wrong window size determination, only with statusbar height 48 I can see text.
Will try to understand where and what I did wrong.
Mac Studio M1Max, PB 6.03Arm64 and x64.
Macbook Air M2, PB 6.03Arm64 and x64.
Windows 10, PB 6.03 x64 and x86.
Macbook Air M2, PB 6.03Arm64 and x64.
Windows 10, PB 6.03 x64 and x86.
-
- Enthusiast
- Posts: 125
- Joined: Wed May 20, 2020 5:19 pm
- Location: The 3rd planet in the Solar System
- Contact:
Re: StatusBar background color.
Looks like this too complicate for me.
I do not understand where the problem.
In the windows module works wrong
But in the Mac - looks GOOD
I do not understand where the problem.
In the windows module works wrong
But in the Mac - looks GOOD
Mac Studio M1Max, PB 6.03Arm64 and x64.
Macbook Air M2, PB 6.03Arm64 and x64.
Windows 10, PB 6.03 x64 and x86.
Macbook Air M2, PB 6.03Arm64 and x64.
Windows 10, PB 6.03 x64 and x86.