Difference between revisions of "Gambas/controls/Form"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(brief About section)
(events - moved from qt library page; doc link; clarified dimension properties)
 
(One intermediate revision by the same user not shown)
Line 6: 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
* W
+
** When window is at top of screen, this will show the width of the window's titlebar
* H
+
* '''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 - always 0?
+
* '''ClientY''' - position of left edge of area containing the controls (read-only)
* ClientY - always 0?
+
* '''ClientW''' / '''ClientWidth''' - width of area containing the controls (read-only)
* ClientW
+
* '''ClientH''' / '''ClientHeight''' - height of area containing the controls (read-only)
* ClientH
 
* ClientWidth
 
* ClientHeight
 
 
| valign=top |
 
| valign=top |
 
===Methods===
 
===Methods===
Line 41: 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.

Properties

dimensions

  • X - left edge of form relative to left 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
  • 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)
  • ClientW / ClientWidth - width of area containing the controls (read-only)
  • ClientH / ClientHeight - height of area containing the controls (read-only)

Methods

  • Center
  • Close
  • Delete
  • Drag
  • FindChild
  • Grab
  • Hide
  • Lower
  • Move
  • MoveScaled
  • Raise
  • Refresh
  • Reparent
  • Resize
  • ResizeScaled
  • SetFocus
  • Show
  • ShowDialog
  • ShowModal
  • 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