It is currently Thu Jun 20, 2013 2:46 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Mac OS - Live ScrollBar, pleaaaase
PostPosted: Thu Mar 10, 2011 8:16 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jan 31, 2006 9:43 am
Posts: 323
Location: France
Pleaaase, is it possible to set the parameter "liveTracking" to "True" when calling the CreateScrollBarControl() API from the Gadget library of PB ? ... so that we can have a "Live ScrollBar" when using the SetControlAction() API to assign a callback function to it.

This already works with PB "TrackBar Gadget", so i assume it is created with the CreateSliderControl() API with the "liveTracking" parameter set to "True".

Code sample to illustrate this (try to drag the sliders/scrollbars) :

Code:
ImportC "/System/Library/Frameworks/Carbon.framework/Carbon"
   NewControlActionUPP.l(*userRoutine)
   SetControlAction(theControl.l, actionProc.l)
   CreateScrollBarControl(window.l, *boundsRect, value.l, minimum.l, maximum.l, viewSize.l, liveTracking.b, liveTrackingProc.l, *outControl)
   ShowControl(theControl.l)
EndImport

Structure Rect
   top.w
   left.w
   bottom.w
   right.w
EndStructure

OpenWindow(0, 100, 100, 500, 200, "Test")

TrackBarGadget(0, 10, 10, 200, 20, 0, 10)
TextGadget(1, 230, 10, 200, 20, "'normal' slider")

TrackBarGadget(2, 10, 50, 200, 20, 0, 10)
TextGadget(3, 230, 50, 200, 20, "'live' slider")

ScrollBarGadget(4, 10, 90, 200, 20, 0, 10, 1)
TextGadget(5, 230, 90, 200, 20, "'normal' scrollbar")

ScrollBarGadget(6, 10, 130, 200, 20, 0, 10, 1)
TextGadget(7, 230, 130, 200, 20, "'live' scrollbar (does not work)")

Rect.Rect : Rect\left = 10 : Rect\top = 170 : Rect\right = 210 : Rect\bottom = 190
CreateScrollBarControl(WindowID(0), @Rect, 0, 0, 10, 1, #True, #Null, @APIScrollBar)
ShowControl(APIScrollBar)
TextGadget(8, 230, 170, 200, 20, "API created 'live' scrollbar")

ProcedureCDLL LiveTrackingProc()
EndProcedure

ControlActionUPP = NewControlActionUPP(@LiveTrackingProc())
SetControlAction(GadgetID(2), ControlActionUPP)
SetControlAction(GadgetID(6), ControlActionUPP)
SetControlAction(APIScrollBar, ControlActionUPP)

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow

_________________
Niffo


Top
 Profile  
 
 Post subject: Re: Mac OS - Live ScrollBar, pleaaaase
PostPosted: Tue Sep 13, 2011 7:41 pm 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2271
Location: UK
Hi,

Not that I want to bump this topic (well, I did, sorry :oops: ) but this change would save me a lot of API calls, and only requires a 5 second fix from PB team :)
Thanks in advance!


Top
 Profile  
 
 Post subject: Re: Mac OS - Live ScrollBar, pleaaaase
PostPosted: Wed Sep 14, 2011 11:23 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 2853
Location: United Kingdom
It would be very handy on Windows too! (don't know if it is possible though).

_________________
http://www.SinisterSoft.com <- My Business website
http://www.ReportComplete.com and http://www.ReportPlus.co.uk <- School end of term reports system


Top
 Profile  
 
 Post subject: Re: Mac OS - Live ScrollBar, pleaaaase
PostPosted: Thu Sep 15, 2011 12:03 am 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2271
Location: UK
DoubleDutch wrote:
It would be very handy on Windows too! (don't know if it is possible though).

Yes, with a workaround (available on this forum), like on MacOSX, but in order to do the Mac workaround the PB scrollbars need to be changed, hence the request :)


Top
 Profile  
 
 Post subject: Re: Mac OS - Live ScrollBar, pleaaaase
PostPosted: Thu Sep 15, 2011 1:20 am 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 2853
Location: United Kingdom
Having live scroll bars makes it possible to do some very interesting canvasgadget work. For example I've done a word-wrapping tree gadget that works directly from my packed data - I've no need to load the tree as it renders directly.

Image
http://ɯoɔ.com/images/tree.jpg

I use the live scroll bar routines that I found on the forum to allow the user to scroll up/down the tree, but if would be much nicer if it was 'native'.

_________________
http://www.SinisterSoft.com <- My Business website
http://www.ReportComplete.com and http://www.ReportPlus.co.uk <- School end of term reports system


Top
 Profile  
 
 Post subject: Re: Mac OS - Live ScrollBar, pleaaaase
PostPosted: Thu Sep 15, 2011 11:24 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 937
Location: New York
I'm missing the obvious here... what do you guys mean by "live" scrollbar? (Don't have a Mac or even PB available to test right now.)


Top
 Profile  
 
 Post subject: Re: Mac OS - Live ScrollBar, pleaaaase
PostPosted: Fri Sep 16, 2011 12:29 am 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2271
Location: UK
kenmo wrote:
I'm missing the obvious here... what do you guys mean by "live" scrollbar? (Don't have a Mac or even PB available to test right now.)

When you scroll using the buttons, you receive an event when you release the button. We want the event when the position has changed (even if it's still changing).

And the specific request for Mac is that even though you move the scrollbar, it won't get moved until you release the button which is very non-standard ;)


Top
 Profile  
 
 Post subject: Re: Mac OS - Live ScrollBar, pleaaaase
PostPosted: Fri Sep 16, 2011 12:33 am 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 937
Location: New York
Ah okay. I think ProgressBarGadgets do that, right? I rarely use ScrollBarGadgets, but that would definitely be useful on all platforms.


Top
 Profile  
 
 Post subject: Re: Mac OS - Live ScrollBar, pleaaaase
PostPosted: Wed Oct 26, 2011 3:59 pm 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2271
Location: UK
Can the live scrollbar on the mac be enabled for 4.60 final please?
It only requires to add a flag ! :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye