Difference between revisions of "Gambas/controls/Form"
Jump to navigation
Jump to search
(some lists) |
(events - moved from qt library page; doc link; clarified dimension properties) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | ==About== | ||
+ | '''Form''' is a control defined in the {{l/sub|gb.gui|Gambas/libraries}} [[Gambas/libraries|library]]. | ||
{| | {| | ||
|- | |- | ||
Line 4: | Line 6: | ||
===Properties=== | ===Properties=== | ||
====dimensions==== | ====dimensions==== | ||
− | * X | + | * '''X''' - left edge of form relative to left of screen, in pixels |
− | * Y | + | * '''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 |
− | * | + | * '''W''' / '''Width''' - width in pixels |
− | * Width | + | * '''H''' / '''Height''' - height in pixels |
− | * Height | + | * '''ClientX''' - position of top edge of area containing the controls (read-only) |
− | * ClientX - | + | * '''ClientY''' - position of left edge of area containing the controls (read-only) |
− | * ClientY - | + | * '''ClientW''' / '''ClientWidth''' - width of area containing the controls (read-only) |
− | * ClientW | + | * '''ClientH''' / '''ClientHeight''' - height of area containing the controls (read-only) |
− | * ClientH | ||
− | |||
− | |||
| valign=top | | | valign=top | | ||
===Methods=== | ===Methods=== | ||
Line 39: | 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.