Home » U++ Library support » Splitter » Splitter: New Callback WhenEndResize
Splitter: New Callback WhenEndResize [message #26823] |
Mon, 31 May 2010 17:27 |
|
Hello,
I propose to add new callback in Splitter class: WhenEndResize.
This callback is very important when i have a ImageCtrl or other control that takes time on refreshing data by resizing (raster size by ctrl size to a big image).
The patch is:
Index: uppsrc/CtrlLib/Splitter.cpp
===================================================================
--- uppsrc/CtrlLib/Splitter.cpp (revision 2445)
+++ uppsrc/CtrlLib/Splitter.cpp (working copy)
@@ -85,6 +85,10 @@
if(HasCapture() && mouseindex >= 0 && mouseindex < pos.GetCount()) {
SetPos(ClientToPos(p), mouseindex);
WhenAction();
+
+ if(!is_captured){
+ is_captured = true;
+ }
}
}
@@ -108,6 +112,11 @@
}
void Splitter::LeftUp(Point p, dword keyflags) {
+ if(is_captured){
+ is_captured = false;
+ if(WhenEndResize)
+ WhenEndResize();
+ }
Refresh();
}
@@ -249,6 +258,7 @@
}
Splitter::Splitter() {
+ is_captured = false;
style = -1;
pos.Add(5000);
width = 4;
Index: uppsrc/CtrlLib/Splitter.h
===================================================================
--- uppsrc/CtrlLib/Splitter.h (revision 2445)
+++ uppsrc/CtrlLib/Splitter.h (working copy)
@@ -7,7 +7,7 @@
virtual void LeftUp(Point p, dword keyflags);
virtual Image CursorImage(Point p, dword keyflags);
virtual void Serialize(Stream& s);
-
+ Callback WhenEndResize;
public:
struct Style : ChStyle<Style> {
Value vert[2], horz[2];
@@ -66,6 +66,8 @@
Splitter();
virtual ~Splitter();
+private:
+ bool is_captured;
};
class SplitterFrame : public CtrlFrame, private Ctrl {
|
|
|
Goto Forum:
Current Time: Fri Nov 01 00:57:15 CET 2024
Total time taken to generate the page: 0.02589 seconds
|