#include <resizec.h>
Inherited by TBasePanel, and wxPictureControl.
Inheritance diagram for wxResizeableControl:
Public Types | |
enum | SizeMoveModes { Top = 0, Bottom, Left, Right, TopLeft, BottomLeft, TopRight, BottomRight, MoveWin, MaxMode } |
Flags for resize mode. More... | |
enum | SizeRads { SizeXRad = 5, SizeYRad = 5 } |
Size box dimension. More... | |
Public Member Functions | |
wxResizeableControl () | |
Ctor. | |
wxResizeableControl (wxWindow *AParent, int AnId, const wxPoint &pos, const wxSize &size, long style=0, const wxString &name=wxPanelNameStr) | |
Ctor. | |
virtual | ~wxResizeableControl () |
Dtor. | |
virtual void | Paint (wxDC &WXUNUSED(dc), bool WXUNUSED(Printing), wxSize &WXUNUSED(size)) |
Paint function for printing and screen output. | |
virtual wxSize | GetOriginalSize () |
Returns original size of control. | |
virtual float | GetRatio () |
Returns with/height ration. | |
wxZoomData & | GetZoomData () |
Returns the zoom data object. | |
void | SetZoom (float Zoom) |
Set new zoom. | |
void | SetCurrentZoom (float Zoom) |
Set new zoom factor, but do not resize/move. | |
void | DrawFocusRect (wxDC &dc, wxRect rct) |
Same as FocusRectCoord but with wxRect parameter. | |
void | DoSetSize (int x, int y, int width, int height, int sizeFlags=wxSIZE_AUTO) |
Make sure the zoom data gets updated when the window is moved. | |
void | OnP (wxPaintEvent &event) |
void | OnSetCursor (wxSetCursorEvent &event) |
Responds to set cursor event. | |
void | OnLButtonUp (wxMouseEvent &event) |
Responds to left button up event. | |
void | OnLButtonDown (wxMouseEvent &event) |
Responds to left button down event. | |
void | OnMouseMove (wxMouseEvent &event) |
Responds to mouse move event. | |
void | OnKillFocus (wxFocusEvent &event) |
Kill focus event hides the size rectangles. | |
void | OnSetFocus (wxFocusEvent &event) |
Set focus event draws size rectangles. | |
void | OnEditCut (wxCommandEvent &ce) |
Cut event deletes the window. | |
void | OnKeyDown (wxKeyEvent &event) |
Key down event of WXK_DELETE deletes the window. | |
void | OnSize (wxSizeEvent &event) |
Reponds to size event. | |
void | OnMove (wxMoveEvent &event) |
Reponds to move event. | |
bool | Destroy () |
Delete this window, let parent know. | |
Protected Member Functions | |
void | FocusRectCoord (wxDC &DC, wxCoord x1, wxCoord y1, wxCoord w, wxCoord h) |
Function that draws a focus rectangle. | |
int | GetSizeX (int Mode) |
Returns x size. | |
int | GetSizeY (int Mode) |
Returns y size. | |
void | DrawMoveRect (wxPoint hp, int Mode, float Ratio=0) |
Draw ored rectangle of current new size (redraw to remove). | |
wxRect | NewRect (wxPoint hp, int Mode, float Ratio=0) |
Return new rectangle size, based on mouse position hp. | |
void | DrawSizeRect (wxDC &dc) |
Draw size boxes for resize. | |
int | PointInSizeRect (wxPoint hp) |
Determine in which size box the pouse position hp is if any. | |
Protected Attributes | |
wxZoomData | m_zoomData |
Zoom data. | |
wxCursor | m_csr |
Current cursor. | |
long | m_curId |
Current cursor id (-1 for non-stock cursor). | |
int | m_capt |
Flag for mouse capture. | |
wxPoint | m_curpos |
Cached mouse cursor positions. | |
wxPoint | m_lastcurpos |
int | m_movemode |
Saved move mode from left button down. | |
bool | m_hasfocus |
Flags for focus and move state. | |
bool | m_moved |
This class draws resize rectangles on each side and corner when focused. Dragging these rectangles resizes the window.
This class needs to be overloaded and Paint() defined with the graphics rendering.
This would make a perfect abstract class, but the definition of wxDynamicCast() doesn't allow this.
Definition at line 90 of file resizec.h.
|
Flags for resize mode.
|
|
Size box dimension.
|
|
Ctor.
|
|
Ctor.
Definition at line 93 of file resizec.cpp. |
|
Dtor.
|
|
Delete this window, let parent know.
Definition at line 432 of file resizec.cpp. Referenced by OnEditCut(). |
|
Make sure the zoom data gets updated when the window is moved.
Definition at line 148 of file resizec.h. References m_zoomData, wxZoomData::Move(), and wxZoomData::SetSize(). |
|
Same as FocusRectCoord but with wxRect parameter.
Definition at line 143 of file resizec.h. References FocusRectCoord(). Referenced by DrawMoveRect(). |
|
Draw ored rectangle of current new size (redraw to remove).
Definition at line 122 of file resizec.cpp. References DrawFocusRect(), and NewRect(). Referenced by OnLButtonUp(), and OnMouseMove(). |
|
Draw size boxes for resize.
Definition at line 243 of file resizec.cpp. References GetSizeX(), GetSizeY(), SizeXRad, and SizeYRad. Referenced by OnKillFocus(), OnP(), wxPictureControl::OnPaint(), and OnSetFocus(). |
|
Function that draws a focus rectangle.
Definition at line 107 of file resizec.cpp. Referenced by DrawFocusRect(). |
|
Returns original size of control.
Reimplemented in wxBitmapControl. Definition at line 124 of file resizec.h. Referenced by wxPictureControl::OnRevert(). |
|
Returns with/height ration.
Reimplemented in wxBitmapControl. Definition at line 126 of file resizec.h. Referenced by OnLButtonUp(), and OnMouseMove(). |
|
Returns x size.
Definition at line 398 of file resizec.cpp. References Bottom, BottomLeft, BottomRight, Left, Right, Top, TopLeft, and TopRight. Referenced by DrawSizeRect(), and PointInSizeRect(). |
|
Returns y size.
Definition at line 415 of file resizec.cpp. References Bottom, BottomLeft, BottomRight, Left, Right, Top, TopLeft, and TopRight. Referenced by DrawSizeRect(), and PointInSizeRect(). |
|
Returns the zoom data object.
Definition at line 131 of file resizec.h. References m_zoomData. |
|
Return new rectangle size, based on mouse position hp.
Definition at line 147 of file resizec.cpp. References Bottom, BottomLeft, BottomRight, Left, m_curpos, MoveWin, Right, Top, TopLeft, and TopRight. Referenced by DrawMoveRect(), and OnLButtonUp(). |
|
Cut event deletes the window.
Reimplemented in wxPictureControl. Definition at line 522 of file resizec.cpp. References Destroy(). |
|
Key down event of WXK_DELETE deletes the window.
Reimplemented in TBasePanel. |
|
Kill focus event hides the size rectangles.
Definition at line 440 of file resizec.cpp. References DrawSizeRect(), and m_hasfocus. |
|
Responds to left button down event.
Definition at line 321 of file resizec.cpp. References m_capt, m_curpos, m_hasfocus, m_lastcurpos, m_moved, m_movemode, MoveWin, and PointInSizeRect(). |
|
Responds to left button up event.
Definition at line 373 of file resizec.cpp. References DrawMoveRect(), GetRatio(), m_capt, m_lastcurpos, m_moved, m_movemode, MoveWin, and NewRect(). |
|
Responds to mouse move event.
Definition at line 349 of file resizec.cpp. References DrawMoveRect(), GetRatio(), m_capt, m_curpos, m_lastcurpos, m_moved, m_movemode, and OnSetCursor(). |
|
Reponds to move event.
Definition at line 535 of file resizec.cpp. References m_zoomData, and wxZoomData::Move(). |
|
Definition at line 449 of file resizec.cpp. References DrawSizeRect(), m_hasfocus, and Paint(). |
|
Responds to set cursor event.
Definition at line 274 of file resizec.cpp. References Bottom, BottomLeft, BottomRight, Left, m_csr, m_curId, m_hasfocus, MoveWin, PointInSizeRect(), Right, Top, TopLeft, and TopRight. Referenced by OnMouseMove(). |
|
Set focus event draws size rectangles.
Definition at line 458 of file resizec.cpp. References DrawSizeRect(), and m_hasfocus. |
|
Reponds to size event.
Reimplemented in PnlGraphFrame, Graph3DFrame, PnlFunzione, and wxPictureControl. Definition at line 527 of file resizec.cpp. References m_zoomData, and wxZoomData::SetSize(). |
|
Paint function for printing and screen output.
Definition at line 122 of file resizec.h. Referenced by OnP(), and wxPictureControl::OnPaint(). |
|
Determine in which size box the pouse position hp is if any.
Definition at line 131 of file resizec.cpp. References GetSizeX(), GetSizeY(), MoveWin, SizeXRad, and SizeYRad. Referenced by OnLButtonDown(), and OnSetCursor(). |
|
Set new zoom factor, but do not resize/move.
Definition at line 138 of file resizec.h. References m_zoomData, and wxZoomData::SetCurrentZoom(). |
|
Set new zoom.
Definition at line 133 of file resizec.h. References m_zoomData, and wxZoomData::SetZoomSize(). |
|
Flag for mouse capture.
Definition at line 198 of file resizec.h. Referenced by OnLButtonDown(), OnLButtonUp(), and OnMouseMove(). |
|
Current cursor. necessary for MSW fake stock cursors (e.g. wxCURSOR_SIZING) together with wxSetCursorEvent(), as the current cursor is not buffered in this case and temporary cursors are automatically unloaded from windows (provided my cursor patch that prevents cursor memory leaks will get implemented) Definition at line 194 of file resizec.h. Referenced by OnSetCursor(). |
|
Current cursor id (-1 for non-stock cursor).
Definition at line 196 of file resizec.h. Referenced by OnSetCursor(). |
|
Cached mouse cursor positions.
Definition at line 200 of file resizec.h. Referenced by NewRect(), OnLButtonDown(), and OnMouseMove(). |
|
Flags for focus and move state.
Definition at line 204 of file resizec.h. Referenced by OnKillFocus(), OnLButtonDown(), OnP(), wxPictureControl::OnPaint(), OnSetCursor(), and OnSetFocus(). |
|
Definition at line 200 of file resizec.h. Referenced by OnLButtonDown(), OnLButtonUp(), and OnMouseMove(). |
|
Definition at line 204 of file resizec.h. Referenced by OnLButtonDown(), OnLButtonUp(), and OnMouseMove(). |
|
Saved move mode from left button down.
Definition at line 202 of file resizec.h. Referenced by OnLButtonDown(), OnLButtonUp(), and OnMouseMove(). |
|
Zoom data.
Definition at line 187 of file resizec.h. Referenced by DoSetSize(), GetZoomData(), OnMove(), OnSize(), SetCurrentZoom(), and SetZoom(). |