Gambas/controls/Form

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< Gambas‎ | controls
Revision as of 20:36, 26 April 2015 by Woozle (talk | contribs) (events - moved from qt library page; doc link; clarified dimension properties)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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