1//--------------------------------------------------------------------------- 2// This file is generated by wxPython's SIP generator. Do not edit by hand. 3// 4// Copyright: (c) 2018 by Total Control Software 5// License: wxWindows License 6// 7// This file will be included by _core.sip 8// 9//--------------------------------------------------------------------------- 10 11%ModuleHeaderCode 12typedef wxScrolled<wxPanel> _ScrolledWindowBase; 13%End 14 15 16//--------------------------------------------------------------------------- 17 18enum wxScrollbarVisibility 19{ 20 wxSHOW_SB_NEVER, 21 wxSHOW_SB_DEFAULT, 22 wxSHOW_SB_ALWAYS 23}; 24 25template<T> 26class wxScrolled : T 27{ 28 %Docstring 29 Scrolled() 30 Scrolled(parent, id=-1, pos=DefaultPosition, size=DefaultSize, style=HSCROLL|VSCROLL, name="scrolledWindow") 31 32 The wxScrolled class manages scrolling for its client area, 33 transforming the coordinates according to the scrollbar positions, and 34 setting the scroll positions, thumb sizes and ranges according to the 35 area in view. 36 %End 37 %TypeHeaderCode 38 #include <wx/scrolwin.h> 39 %End 40 41public: 42 wxScrolled(); 43 %PreMethodCode 44 if (!wxPyCheckForApp()) return NULL; 45 %End 46 47 wxScrolled( 48 wxWindow * parent /TransferThis/, 49 wxWindowID id = -1, 50 const wxPoint & pos = wxDefaultPosition, 51 const wxSize & size = wxDefaultSize, 52 long style = wxHSCROLL|wxVSCROLL, 53 const wxString & name = "scrolledWindow" 54 ); 55 %PreMethodCode 56 if (!wxPyCheckForApp()) return NULL; 57 %End 58 59 void CalcScrolledPosition( 60 int x, 61 int y, 62 int * xx /Out/, 63 int * yy /Out/ 64 ) const; 65 %Docstring 66 CalcScrolledPosition(x, y) -> (xx, yy) 67 CalcScrolledPosition(pt) -> Point 68 69 Translates the logical coordinates to the device ones. 70 %End 71 72 wxPoint CalcScrolledPosition( 73 const wxPoint & pt 74 ) const; 75 76 void CalcUnscrolledPosition( 77 int x, 78 int y, 79 int * xx /Out/, 80 int * yy /Out/ 81 ) const; 82 %Docstring 83 CalcUnscrolledPosition(x, y) -> (xx, yy) 84 CalcUnscrolledPosition(pt) -> Point 85 86 Translates the device coordinates to the logical ones. 87 %End 88 89 wxPoint CalcUnscrolledPosition( 90 const wxPoint & pt 91 ) const; 92 93 bool Create( 94 wxWindow * parent /TransferThis/, 95 wxWindowID id = -1, 96 const wxPoint & pos = wxDefaultPosition, 97 const wxSize & size = wxDefaultSize, 98 long style = wxHSCROLL|wxVSCROLL, 99 const wxString & name = "scrolledWindow" 100 ); 101 %Docstring 102 Create(parent, id=-1, pos=DefaultPosition, size=DefaultSize, style=HSCROLL|VSCROLL, name="scrolledWindow") -> bool 103 104 Creates the window for two-step construction. 105 %End 106 107 void DisableKeyboardScrolling(); 108 %Docstring 109 DisableKeyboardScrolling() 110 111 Disable use of keyboard keys for scrolling. 112 %End 113 114 void DoPrepareDC( 115 wxDC & dc 116 ); 117 %Docstring 118 DoPrepareDC(dc) 119 120 Call this function to prepare the device context for drawing a 121 scrolled image. 122 %End 123 124 void EnableScrolling( 125 bool xScrolling, 126 bool yScrolling 127 ); 128 %Docstring 129 EnableScrolling(xScrolling, yScrolling) 130 131 Enable or disable use of wxWindow::ScrollWindow() for scrolling. 132 %End 133 134 void ShowScrollbars( 135 wxScrollbarVisibility horz, 136 wxScrollbarVisibility vert 137 ); 138 %Docstring 139 ShowScrollbars(horz, vert) 140 141 Set the scrollbar visibility. 142 %End 143 144 void GetScrollPixelsPerUnit( 145 int * xUnit /Out/, 146 int * yUnit /Out/ 147 ) const; 148 %Docstring 149 GetScrollPixelsPerUnit() -> (xUnit, yUnit) 150 151 Get the number of pixels per scroll unit (line), in each direction, as 152 set by SetScrollbars(). 153 %End 154 155 void GetViewStart( 156 int * x /Out/, 157 int * y /Out/ 158 ) const; 159 %Docstring 160 GetViewStart() -> (x, y) 161 162 Get the position at which the visible portion of the window starts. 163 %End 164 165 bool IsRetained() const; 166 %Docstring 167 IsRetained() -> bool 168 169 Motif only: true if the window has a backing bitmap. 170 %End 171 172 virtual 173 void OnDraw( 174 wxDC & dc 175 ); 176 %Docstring 177 OnDraw(dc) 178 179 Called by the default paint event handler to allow the application to 180 define painting behaviour without having to worry about calling 181 DoPrepareDC(). 182 %End 183 184 void PrepareDC( 185 wxDC & dc 186 ); 187 %Docstring 188 PrepareDC(dc) 189 190 This function is for backwards compatibility only and simply calls 191 DoPrepareDC() now. 192 %End 193 194 void Scroll( 195 int x, 196 int y 197 ); 198 %Docstring 199 Scroll(x, y) 200 Scroll(pt) 201 202 Scrolls a window so the view start is at the given point. 203 %End 204 205 void Scroll( 206 const wxPoint & pt 207 ); 208 209 void SetScrollRate( 210 int xstep, 211 int ystep 212 ); 213 %Docstring 214 SetScrollRate(xstep, ystep) 215 216 Set the horizontal and vertical scrolling increment only. 217 %End 218 219 void SetScrollbars( 220 int pixelsPerUnitX, 221 int pixelsPerUnitY, 222 int noUnitsX, 223 int noUnitsY, 224 int xPos = 0, 225 int yPos = 0, 226 bool noRefresh = false 227 ); 228 %Docstring 229 SetScrollbars(pixelsPerUnitX, pixelsPerUnitY, noUnitsX, noUnitsY, xPos=0, yPos=0, noRefresh=False) 230 231 Sets up vertical and/or horizontal scrollbars. 232 %End 233 234 void SetTargetWindow( 235 wxWindow * window 236 ); 237 %Docstring 238 SetTargetWindow(window) 239 240 Call this function to tell wxScrolled to perform the actual scrolling 241 on a different window (and not on itself). 242 %End 243 244 wxWindow * GetTargetWindow() const; 245 %Docstring 246 GetTargetWindow() -> Window 247 %End 248 249 void SetTargetRect( 250 const wxRect & rect 251 ); 252 %Docstring 253 SetTargetRect(rect) 254 %End 255 256 wxRect GetTargetRect() const; 257 %Docstring 258 GetTargetRect() -> Rect 259 %End 260 261 int GetScrollPageSize( 262 int orient 263 ) const; 264 %Docstring 265 GetScrollPageSize(orient) -> int 266 %End 267 268 void SetScrollPageSize( 269 int orient, 270 int pageSize 271 ); 272 %Docstring 273 SetScrollPageSize(orient, pageSize) 274 %End 275 276 int GetScrollLines( 277 int orient 278 ) const; 279 %Docstring 280 GetScrollLines(orient) -> int 281 %End 282 283 void SetScale( 284 double xs, 285 double ys 286 ); 287 %Docstring 288 SetScale(xs, ys) 289 %End 290 291 double GetScaleX() const; 292 %Docstring 293 GetScaleX() -> double 294 %End 295 296 double GetScaleY() const; 297 %Docstring 298 GetScaleY() -> double 299 %End 300 301 void AdjustScrollbars(); 302 %Docstring 303 AdjustScrollbars() 304 %End 305 306 bool IsAutoScrolling() const; 307 %Docstring 308 IsAutoScrolling() -> bool 309 310 Are we generating the autoscroll events? 311 %End 312 313 void StopAutoScrolling(); 314 %Docstring 315 StopAutoScrolling() 316 317 Stop generating the scroll events when mouse is held outside the 318 window. 319 %End 320 321 virtual 322 bool SendAutoScrollEvents( 323 wxScrollWinEvent & event 324 ) const; 325 %Docstring 326 SendAutoScrollEvents(event) -> bool 327 328 This method can be overridden in a derived class to forbid sending the 329 auto scroll events - note that unlike StopAutoScrolling() it doesn't 330 stop the timer, so it will be called repeatedly and will typically 331 return different values depending on the current mouse position. 332 %End 333 334 private: 335 wxScrolled(const wxScrolled&); 336 337 338 private: 339 wxScrolled& operator=(const wxScrolled&); 340 341 342 public: 343 virtual wxPoint GetClientAreaOrigin() const; 344 virtual bool Validate(); 345 virtual bool TransferDataToWindow(); 346 virtual bool TransferDataFromWindow(); 347 virtual void InitDialog(); 348 virtual bool AcceptsFocus() const; 349 virtual bool AcceptsFocusRecursively() const; 350 virtual bool AcceptsFocusFromKeyboard() const; 351 virtual void AddChild( wxWindowBase *child ); 352 virtual void RemoveChild( wxWindowBase *child ); 353 virtual void InheritAttributes(); 354 virtual bool ShouldInheritColours() const; 355 virtual void OnInternalIdle(); 356 virtual wxWindow *GetMainWindowOfCompositeControl(); 357 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); 358 virtual void SetCanFocus(bool canFocus); 359 virtual bool Destroy(); 360 virtual void SetValidator( const wxValidator &validator ); 361 virtual wxValidator* GetValidator(); 362 363 364 protected: 365 virtual bool ProcessEvent(wxEvent & event); 366 virtual void DoEnable(bool enable); 367 virtual void DoGetPosition(int *x, int *y) const; 368 virtual void DoGetSize(int *width, int *height) const; 369 virtual void DoGetClientSize(int *width, int *height) const; 370 virtual wxSize DoGetBestSize() const; 371 virtual wxSize DoGetBestClientSize() const; 372 virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); 373 virtual void DoSetClientSize(int width, int height); 374 virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); 375 virtual wxSize DoGetBorderSize() const; 376 virtual void DoMoveWindow(int x, int y, int width, int height); 377 virtual void DoSetWindowVariant( wxWindowVariant variant); 378 virtual wxBorder GetDefaultBorder() const; 379 virtual wxBorder GetDefaultBorderForControl() const; 380 virtual void DoFreeze(); 381 virtual void DoThaw(); 382 virtual bool HasTransparentBackground(); 383 virtual bool TryBefore(wxEvent& event); 384 virtual bool TryAfter(wxEvent& event); 385 386 387 public: 388 389 390 static 391 wxVisualAttributes GetClassDefaultAttributes( 392 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 393 ); 394 %Docstring 395 GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes 396 %End 397 %PreMethodCode 398 if (!wxPyCheckForApp()) return NULL; 399 %End 400 401 public: 402 403 404 %Property(name=ScaleX, get=GetScaleX) 405 %Property(name=ScaleY, get=GetScaleY) 406 %Property(name=TargetRect, get=GetTargetRect, set=SetTargetRect) 407 %Property(name=TargetWindow, get=GetTargetWindow, set=SetTargetWindow) 408 409protected: 410 virtual 411 wxSize GetSizeAvailableForScrollTarget( 412 const wxSize & size 413 ); 414 %Docstring 415 GetSizeAvailableForScrollTarget(size) -> Size 416 417 Function which must be overridden to implement the size available for 418 the scroll target for the given size of the main window. 419 %End 420 421}; // end of class wxScrolled 422 423 424typedef wxScrolled<wxWindow > wxScrolledCanvas; 425 426typedef wxScrolled<wxPanel> _ScrolledWindowBase /NoTypeName/; 427 428class wxScrolledWindow : _ScrolledWindowBase 429{ 430 %Docstring 431 ScrolledWindow() 432 ScrolledWindow(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=ScrolledWindowStyle, name=PanelNameStr) 433 434 Scrolled window derived from wxPanel. 435 %End 436public: 437 wxScrolledWindow(); 438 %PreMethodCode 439 if (!wxPyCheckForApp()) return NULL; 440 %End 441 442 wxScrolledWindow( 443 wxWindow* parent /TransferThis/, 444 wxWindowID id = wxID_ANY, 445 const wxPoint& pos = wxDefaultPosition, 446 const wxSize& size = wxDefaultSize, 447 long style = wxScrolledWindowStyle, 448 const wxString& name = wxPanelNameStr 449 ); 450 %PreMethodCode 451 if (!wxPyCheckForApp()) return NULL; 452 %End 453 454 void SetFocusIgnoringChildren(); 455 %Docstring 456 SetFocusIgnoringChildren() 457 458 In contrast to SetFocus() this will set the focus to the panel even if 459 there are child windows in the panel. This is only rarely needed. 460 %End 461 462 public: 463 virtual wxPoint GetClientAreaOrigin() const; 464 virtual bool Validate(); 465 virtual bool TransferDataToWindow(); 466 virtual bool TransferDataFromWindow(); 467 virtual void InitDialog(); 468 virtual bool AcceptsFocus() const; 469 virtual bool AcceptsFocusRecursively() const; 470 virtual bool AcceptsFocusFromKeyboard() const; 471 virtual void AddChild( wxWindowBase *child ); 472 virtual void RemoveChild( wxWindowBase *child ); 473 virtual void InheritAttributes(); 474 virtual bool ShouldInheritColours() const; 475 virtual void OnInternalIdle(); 476 virtual wxWindow *GetMainWindowOfCompositeControl(); 477 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); 478 virtual void SetCanFocus(bool canFocus); 479 virtual bool Destroy(); 480 virtual void SetValidator( const wxValidator &validator ); 481 virtual wxValidator* GetValidator(); 482 483 484 protected: 485 virtual bool ProcessEvent(wxEvent & event); 486 virtual void DoEnable(bool enable); 487 virtual void DoGetPosition(int *x, int *y) const; 488 virtual void DoGetSize(int *width, int *height) const; 489 virtual void DoGetClientSize(int *width, int *height) const; 490 virtual wxSize DoGetBestSize() const; 491 virtual wxSize DoGetBestClientSize() const; 492 virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); 493 virtual void DoSetClientSize(int width, int height); 494 virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); 495 virtual wxSize DoGetBorderSize() const; 496 virtual void DoMoveWindow(int x, int y, int width, int height); 497 virtual void DoSetWindowVariant( wxWindowVariant variant); 498 virtual wxBorder GetDefaultBorder() const; 499 virtual wxBorder GetDefaultBorderForControl() const; 500 virtual void DoFreeze(); 501 virtual void DoThaw(); 502 virtual bool HasTransparentBackground(); 503 virtual bool TryBefore(wxEvent& event); 504 virtual bool TryAfter(wxEvent& event); 505 506 507 public: 508 509 510 static 511 wxVisualAttributes GetClassDefaultAttributes( 512 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 513 ); 514 %Docstring 515 GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes 516 %End 517 %PreMethodCode 518 if (!wxPyCheckForApp()) return NULL; 519 %End 520 521}; // end of class wxScrolledWindow 522 523 524%Extract(id=pycode_core) 525PyScrolledWindow = wx.deprecated(ScrolledWindow, 'Use ScrolledWindow instead.') 526 527%End 528 529 530//--------------------------------------------------------------------------- 531 532