Page 2 of 3
Posted: Fri Jul 23, 2004 5:38 pm
by localmotion34
wow--you got props from The Man. all i got to say is that i never could get that to work, and now i know it was because of the weird structures associated with the rebar. can i just say that the MS programmers must have lost all touch with reality when they dreamed up the way they wrote this. so is anyone going to make a LIB out of it, or i remember freak or one of the them saying the PB will someday include a native rebar.
Posted: Fri Jul 23, 2004 9:59 pm
by Sparkie
Thank you all for the *thumbs up* on this one. All I did was convert some code over to PB and presto whamo it worked. 8O
@Fred - It is I who thanks YOU for bringing PB to us all so that we can accomplish tasks such as this one
As for making a lib...I am not the best candidate for doing this but maybe it's time I got some practice.
@Shopro - I'm not sure what can be done about the underline problem. If I find anything I'll let you know.
Posted: Sat Jul 24, 2004 12:30 am
by Shopro
Sparkie:
Ah, ok. I'll do some experimenting!
And yeah, I'd love to see a lib such as this. Would make alot of PB interfaces much professional.
-Shopro
Posted: Sat Jul 24, 2004 12:47 am
by Sparkie
@Shopro - The Address(&a) with underline works here with XP skin support enabled so I assume you want the same underline result with XP Skin support disabled. Is that correct?
Posted: Sat Jul 24, 2004 1:15 am
by Shopro
Sparkie:
Oh, didn't notice that it displays fine in the XP skin. Is it "standard" to have an & displayed with "(&a)" without the XP skin?
Thanks
-Shopro
Posted: Sat Jul 24, 2004 3:21 pm
by Sparkie
AFAIK, the ampersand (&) for underlining is standard Windows protocol. I think the problem is that not all controls (gadgets/windows) adhere to this standard. If you change this line in the original code
Code: Select all
TextGadget(2, 200, 100, 400, 20, "Clicking on any of the text labels in the Rebar also resizes the band.")
to this
Code: Select all
TextGadget(2, 200, 100, 400, 20, "&Clicking on any of the text labels in the Rebar also resizes the band.")
you'll see the underline works with or without XP skins (Look at the top TextGadget in the main window and the C in Clicking should be underlined)
I don't yet know how to overcome this so maybe someone else has an idea?
Posted: Sat Jul 24, 2004 3:39 pm
by Dare2
Really nice!
Posted: Sat Jul 24, 2004 3:53 pm
by Shopro
Sparkie:
Ah, I see. I'll just go on hoping someone will have the answer later
thanks again!
-Shopro
Posted: Sun Jul 25, 2004 7:54 am
by Shopro
I've implemented Sparkie's code in my project, but I've run into a simple problem. I don't know how to GetHeight() of the current Rebar.
Any easy solution?
Thanks!
-Shopro
Posted: Sun Jul 25, 2004 1:18 pm
by Sparkie
@Shopro - A little API SendMessage_() is needed for Rebar height:
Code: Select all
Global hwndRB
...
...
...
rebarHeight = SendMessage_(hwndRB, #RB_GETBARHEIGHT, 0, 0)
Keep in mind that unless you lock the rebar, the height can change if the the user drags a band downward or upward. You can lock the rebar by adding the #RBBS_FIXEDSIZE to the rebar fStyle member
Code: Select all
rbBand\fStyle = #RBBS_CHILDEDGE | #RBBS_FIXEDSIZE
Posted: Sun Jul 25, 2004 1:28 pm
by Shopro
Thanks Sparkie!
I was experimenting with SendMessage_() for the last hour or so, but couldn't find it.
Now I can move on
-Shopro
Posted: Sun Jul 25, 2004 1:31 pm
by Shopro
err... is there a way to tell if the user has changed the rebar height?
Does it return some event?
I need this because I want to resize other gadgets when the user resizes the rebar. Thanks!
-Shopro
Posted: Sun Jul 25, 2004 1:44 pm
by Sparkie
#RBN_HEIGHTCHANGE Notification
Sent by a rebar control when its height has changed. This notification message is sent in the form of a WM_NOTIFY message.
Here's a link to msdn for more Rebar information.
Set up a windowcallback to catch the notification and you should be good to go.

Posted: Sun Jul 25, 2004 2:20 pm
by Shopro
Thanks again for the info Sparkie,
but... I'm not so familiar with the windowcallback thingy.
This is what i've done so far:
Code: Select all
Declare Callback(WindowID, Message, wParam, lParam)
Window_Main_Open()
SetWindowCallback(@Callback())
.
.
.
Procedure Callback(WindowID, Message, wParam, lParam)
If Message = #RBN_HEIGHTCHANGE
Debug "Rebar height changed!!!"
EndIf
EndProcedure
But not getting any results. I know that I'm doing something wrong. could someone please point it out?
-Shopro
Posted: Sun Jul 25, 2004 2:49 pm
by Sparkie
Set your window callback
Code: Select all
SetWindowCallback(@myWindowCallback())
The window callback procedure
Code: Select all
Procedure myWindowCallback(hwnd, message, wParam, lParam)
result = #PB_ProcessPureBasicEvents
If message = #WM_NOTIFY
*pNMH.NMHDR = lParam
If *pNMH\hwndFrom = hwndRB
Select *pNMH\code
Case #RBN_HEIGHTCHANGE
rebarHeight = SendMessage_(hwndRB, #RB_GETBARHEIGHT, 0, 0)
Debug "Rebar height is now " + Str(rebarHeight)
EndSelect
EndIf
EndIf
ProcedureReturn result
EndProcedure