|
From: Davy D. <dd...@ne...> - 2001-12-11 05:02:16
|
Hi, I'm brand new to FOX, but have already had fairly good success creating a GUI with fox for an application I'm writing. I'm writing an audio editor for linux and I'm trying to create a new FOX widget, FXWaveView that's derived from another FOX class. What this widget has to do specifically, is draw the wave form... It's going to detect mouse clicks to make selections and such... and I've already been successful drawing the waveform on a canvas (just separately in a test app).... What I need to know is: what's the best way to implement scrolling here... The widget will be given a pointer to a loaded sound object from which it can get the audio data to draw. I'm going to make a zoom parameter that says at what level to draw the wave form... And when the zoom is such that the wave form is wider than the canvas I need to be able to scroll it... I'd like the scroll bars to always be visible and not come and go as needed... I didn't know if it'd be best to instantiate a canvas and a scroll bar (actually 2 scroll bars.. Vertand Horz, but I'm just worried about Horz right now)) and just get notified when the scroll bar is scrolled.. Also, I'd like to have auto scrolling available where it will scroll if you're holding the mouse button down and move the mouse outside the canvas.... Well, I saw that FXScrollArea had some functionality like this.... But I tried using FXScrollArea and putting a canvas inside, and I could not for my life get the H scroll bar to be able to scroll... how do I set the content size of the FXScrollArea... Am I thinking right that the canvas will always be at 0,0-w,h in there and I'll just draw on it but offset the data I'm drawing based on the H scroll bar's position? Or is there a better way altogether for doing this? Thanks, Davy |