Windows Explorer Type Customizable Toolbars

Everything else that doesn't fall into one of the other PB categories.
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post 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.

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post 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 :D

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.
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Shopro
Enthusiast
Enthusiast
Posts: 148
Joined: Tue May 13, 2003 8:05 am

Post 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
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post 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?
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Shopro
Enthusiast
Enthusiast
Posts: 148
Joined: Tue May 13, 2003 8:05 am

Post 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
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post 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?
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Really nice!
@}--`--,-- A rose by any other name ..
Shopro
Enthusiast
Enthusiast
Posts: 148
Joined: Tue May 13, 2003 8:05 am

Post by Shopro »

Sparkie:
Ah, I see. I'll just go on hoping someone will have the answer later :)

thanks again!

-Shopro
Shopro
Enthusiast
Enthusiast
Posts: 148
Joined: Tue May 13, 2003 8:05 am

Post 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
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post 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
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Shopro
Enthusiast
Enthusiast
Posts: 148
Joined: Tue May 13, 2003 8:05 am

Post 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
Shopro
Enthusiast
Enthusiast
Posts: 148
Joined: Tue May 13, 2003 8:05 am

Post 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
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post 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. :)
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Shopro
Enthusiast
Enthusiast
Posts: 148
Joined: Tue May 13, 2003 8:05 am

Post 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
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post 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
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Post Reply