Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Window not scrolling
Window not scrolling [message #43028] Thu, 24 April 2014 13:34 Go to previous message
SkuldOMG is currently offline  SkuldOMG
Messages: 2
Registered: April 2014
Junior Member
I'm currently writing a windows application using the U++ IDE. One window that is used for data entry contains more fields to be displayed than can be fit into a single screen, so I wanted to add a scrollbar to my window. So far, so good, I looked up the ScrollBar example on the U++ page and tried to implement it in my application. My problem is - it just doesn't scroll. I suspect that it has to do with my application having multiple windows, but I'm not sure. Here's how my application is structured:

GUI_APP_MAIN {
MainWindow app;
...
app.Run();
}

struct MainWindow : TopWindow {
PatientFrame dlg;
...
// Opens window that displays a patient overview
void new_patient() {
...
dlg.Execute();
}

...

struct PatientFrame : TopWindow {
ProcessFrame proc;
...
// Opens the window that should have a scrollbar
void new_process() {
...
proc.Execute();
}
}

struct ProcessFrame : TopWindow {
...
// Nearly 1:1 from the example
ScrollBar sb;

virtual void Layout() {
sb.SetPage(GetSize().cy);
}

virtual void MouseWheel(Point, int zdelta, dword) {
sb.Wheel(zdelta);
}

bool Key(dword key, int) {
return sb.VertKey(key);
}

// n is the number of entryfields I have, each entryfield is 21 pixels high
void SetCount(int n) {
sb.SetTotal(n * 21);
}

void Scroll() {
Refresh();
}

void buildList() {
// Constructs the contents of the window
...
// Sets the size for the scrollbar
SetCount(count);
}

...

typedef ProcessFrame CLASSNAME;

ProcessFrame() {
SetRect(0, 0, 720, 435);
Title("Process Frame").Sizeable().Zoomable();
...
AddFrame(sb);
sb.WhenScroll = THISBACK(Scroll);
sb.SetLine(21);
}
}

Now the scrollbar itself displays just fine. Also its size seems to be set correctly, since when I resize the window to be smaller, the scrollbar adjusts itself, same thing when I resize it bigger. I also tried playing around with the size of one line, again, the scrollbar adjusts just fine. The only problem is, it does not actually scroll the view area.

Any help would be appreciated.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: FontPusher Ctrl
Next Topic: Bugfix: DocEdit, not to put back to wantfocus after clicking into it
Goto Forum:
  


Current Time: Sat Apr 27 01:54:21 CEST 2024

Total time taken to generate the page: 0.03060 seconds