Gambas/controls/Form: Difference between revisions
from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
some answers |
events - moved from qt library page; doc link; clarified dimension properties |
||
| Line 9: | Line 9: | ||
* '''Y''' - top edge of form relative to top of screen, in pixels | * '''Y''' - top edge of form relative to top of screen, in pixels | ||
** When window is at top of screen, this will show the width of the window's titlebar | ** When window is at top of screen, this will show the width of the window's titlebar | ||
* '''W''' | * '''W''' / '''Width''' - width in pixels | ||
* '''H''' / '''Height''' - height in pixels | |||
* ''' | * '''ClientX''' - position of top edge of area containing the controls (read-only) | ||
* '''ClientY''' - position of left edge of area containing the controls (read-only) | |||
* '''ClientX''' - | * '''ClientW''' / '''ClientWidth''' - width of area containing the controls (read-only) | ||
* '''ClientY''' - | * '''ClientH''' / '''ClientHeight''' - height of area containing the controls (read-only) | ||
* '''ClientW''' | |||
* ''' | |||
| valign=top | | | valign=top | | ||
===Methods=== | ===Methods=== | ||
| Line 42: | Line 38: | ||
* ShowPopup | * ShowPopup | ||
|} | |} | ||
==Events== | |||
===state-change=== | |||
* '''Open'''() and '''Show'''() are both called before the form has displayed | |||
* '''Activate'''() is called when the form gets focus (title bar changes color, in most color schemes) | |||
* '''Enter'''() is called whenever the mouse enters the drawing region of the form (menu bar & frame aren't included) | |||
* '''Leave'''() is called whenever the mouse leaves the drawing region of the form | |||
* '''Deactivate'''() is called whenever the form loses focus | |||
* nothing seems to trigger '''GotFocus'''() and '''LostFocus'''(); perhaps these are only used for controls (suggests the inheritance structure isn't set up quite right) | |||
* '''Unknown''': | |||
** '''Arrange'''() | |||
** '''BeforeArrange'''() - presumably related to Arrange() | |||
Unfortunately, there doesn't seem to be any event which is called exactly ''once'', ''after'' the form is visible; the best [[kluge]] seems to be to put any such code in the '''Activate''' event and check/set a flag so it only gets called once. | |||
==Links== | |||
===Official=== | |||
* [http://gambaswiki.org/wiki/comp/gb.qt4/form Form (gb.qt4)] | |||
Latest revision as of 20:36, 26 April 2015
About
Form is a control defined in the gb.gui library.
Propertiesdimensions
|
Methods
|
Events
state-change
- Open() and Show() are both called before the form has displayed
- Activate() is called when the form gets focus (title bar changes color, in most color schemes)
- Enter() is called whenever the mouse enters the drawing region of the form (menu bar & frame aren't included)
- Leave() is called whenever the mouse leaves the drawing region of the form
- Deactivate() is called whenever the form loses focus
- nothing seems to trigger GotFocus() and LostFocus(); perhaps these are only used for controls (suggests the inheritance structure isn't set up quite right)
- Unknown:
- Arrange()
- BeforeArrange() - presumably related to Arrange()
Unfortunately, there doesn't seem to be any event which is called exactly once, after the form is visible; the best kluge seems to be to put any such code in the Activate event and check/set a flag so it only gets called once.
