Main Window and Others
Previous topic  First topic  Next topic








X11 Peculiarities

On X11, a window does not have a frame until the window manager decorates it. This happens asynchronously at some point in time after calling window SHOW and the first paint event the window receives, or it does not happen at all. Bear in mind that X11 is policy-free (others call it flexible). Thus you cannot make any safe assumption about the decoration frame your window will get. Basic rule: There's always one user who uses a window manager that breaks your assumption, and who will complain to you.

Furthermore, a toolkit cannot simply place windows on the screen. All Qt can do is to send certain hints to the window manager. The window manager, a separate process, may either obey, ignore or misunderstand them. Due to the partially unclear Inter-Client Communication Conventions Manual (ICCCM), window placement is handled quite differently in existing window managers.

X11 provides no standard or easy way to get the frame geometry once the window is decorated. Qt solves this problem with nifty heuristics and clever code that works on a wide range of window managers that exist today. Don't be surprised if you find one where "getTitleBarHeight" or "getBorder*" methods returns wrong results though.

Nor does X11 provide a way to maximize a window. MAXIMIZED .T. has to emulate the feature. Its result depends on the result of QWidget::frameGeometry() and the capability of the window manager to do proper window placement, neither of which can be guaranteed.




Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE WINDOW cName | (cVarName) | &(cExpression) 
      [ PARENT cParentName ]
NIL
  
Parent window for this window
      [ PARENTTYPE n/a ]   
Only for mg_get() function, this property returns the PARENT control type or "" if the parent was not set.
      [ ROW nRow ]
0
  
Row position on container desktop in pixels coordinates
      [ COL nCol ]
0
  
Col position on container desktop in pixels coordinates
      [ WIDTH nWidth ]
?
  
The desired width size of the window in pixels
      [ HEIGHT nHeight ]
?
  
The desired height size of the window in pixels
      [ ROWBOTTOM nRow ]
n/a
  
Bottom Row position on container desktop in pixels coordinates. This property adjust the HEIGHT property according the ROW property.
      [ COLRIGHT nCol ]
n/a
  
Right Col position on container desktop in pixels coordinates. This property adjust the WIDTH property according the COL property.
      [ VIRTUALWIDTH nVirtualWidth ]
0
  
The desired virtual width size of the window in pixels. This property must be greater than WIDTH property and it enabled the horizontal scroll bar
      [ VIRTUALHEIGHT nVirtualHeight ]
0
  
The desired virtual height size of the window in pixels. This property must be greater than HEIGHT property and it enabled the vertical scroll bar
      [ HSCROLL nTypeScrollBar ]
Qt_ScrollBarAsNeeded
  
This property enable/disable the horizontal scrollbar for VIRTUALWIDTH property. Accepted values are:
Qt_ScrollBarAsNeeded = Shows a scroll bar when the content is too large to fit and not otherwise. This is the default.
Qt_ScrollBarAlwaysOff = Never shows a scroll bar.
Qt_ScrollBarAlwaysOn = Always shows a scroll bar.
      [ VSCROLL nTypeScrollBar ]
Qt_ScrollBarAsNeeded
  
This property enable/disable the vertical scrollbar for VIRTUALHEIGHT property. Accepted values are:
Qt_ScrollBarAsNeeded = Shows a scroll bar when the content is too large to fit and not otherwise. This is the default.
Qt_ScrollBarAlwaysOff = Never shows a scroll bar.
Qt_ScrollBarAlwaysOn = Always shows a scroll bar.
      [ HSCROLLVALUE nValue ]
0
  
This property move the horizontal scrollbar to nValue. This ScrollBar is used when VIRTUALWIDTH property is used. The minumum and maximun values can be consulted/seted by HScrollMin and HScrollMax properties.
      [ VSCROLLVALUE nValue ]
0
  
This property move the vertical scrollbar to nValue. This ScrollBar is used when VIRTUALHEIGHT property is used. The minumum and maximun values can be consulted/seted by VScrollMin and VScrollMax properties.
      [ HSCROLLMIN nValueMin ]
0
  
This property is used to get/set the minimum value for the horizontal scrollbar. This ScrollBar is used when VIRTUALWIDTH property is used.
      [ HSCROLLMAX nValueMax ]
Window.VIRTUALWIDTH
  
This property is used to get/set the maximum value for the horizontal scrollbar. This ScrollBar is used when VIRTUALWIDTH property is used.
      [ VSCROLLMIN nValueMin ]
0
  
This property is used to get/set the minimum value for the vertical scrollbar. This ScrollBar is used when VIRTUALHEIGHT property is used.
      [ VSCROLLMAX nValueMax ]
Window.VIRTUALHEIGHT
  
This property is used to get/set the maximum value for the vertical scrollbar. This ScrollBar is used when VIRTUALHEIGHT property is used.
      [ CAPTION cCaption ]
NIL
  
A text expressions for the window title
      [ MAIN .T. | .F. ]
.F.
  
Set window to main type
      [ CHILD .T. | .F. ]
.F.
  
Set window to child type
      [ MODAL .T. | .F. ]
.F.
  
Set window to modal type
      [ TOPMOST .T. | .F. ]
.F.
  
Set window always on top
      [ HASFOCUS ]   
Only for mg_Get() function. This property returns .T. if window has the application focus
      [ CURSOR ]
Qt_ArrowCursor
  
Change the cursor pointer shape for the window. Go to to learn more about it.
      [ ICON cIconName ]
NIL
  
Image for display as icon window. If window isn't MAIN, Marinas-GUI get the parent window automatically from Main window
      [ NOCAPTION .T. | .F. ]
.F.
  
Window without title bar
      [ NOCLOSEBUTTON .T. | .F. ]
.F.
  
Window with title bar but without CLOSE button
      [ NOMAXIMIZEBUTTON .T. | .F. ]
.F.
  
Window with title bar but without MAXIMIZE button
      [ NOMINIMIZEBUTTON .T. | .F. ]
.F.
  
Window with title bar but without MINIMIZE button
      [ NOSIZE .T. | .F. ]
.F.
  
Window with title bar but without SIZE buttons
      [ NOSYSMENU .T. | .F. ]
.F.
  
Window with title bar but without SYSTEM menu
      [ NOWAIT .T. | .F. ]
.F.
  
When the windows is activated, the flow of program don't stop waiting for an event an execute the following sentence
      [ ENTERTAB .T. | .F. | NIL ]
NIL
  
This property set the TAB key simulation when user press ENTER key in a control. Typically used for DATA ENTRY tasks. A NIL (default) value will use the global SET ENTERTAB value.
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
      [ FONTCOLOR {aFontColor} | aVarFontColor ]
OS.FontColor
  
Set foreground color (text color)
      [ FONTNAME "cFontName" ]
Parent.Fontname
  
Font family for window text
      [ FONTSIZE nPoints ]
Parent.FontSize
  
Font size for window text
      [ FONTBOLD .T. | .F. ]
.F.
  
Set Bold attribute to window text
      [ FONTITALIC .T. | .F. ]
.F.
  
Set Italic attribute to window text
      [ FONTUNDERLINE .T. | .F. ]
.F.
  
Set Underline attribute to window text
      [ FONTSTRIKEOUT .T. | .F. ]
.F.
  
Set Strikeout attribute to window text
      [ ENABLED .T. | .F. ]
.T.
  
Enable or Disable ALL controls in windows
      [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide window (like methods SHOW and HIDE, and like INITIALSHOWMODE QWindow_Normal and QWindow_HIDDEN)
      [ INITIALSHOWMODE nOption ]
QWindow_Normal
  
Initial state for an ACTIVATED window.
Accepted values:
QWindow_Normal (default)
QWindow_Hidden (like VISIBLE .F.)
QWindow_Minimized
QWindow_Maximized
QWindow_FullScreen
      [ ONCHANGEHSCROLL cOnChangeHScroll | {BOnChangeHScroll} ]
NIL
  
An action to be performed when the Horizontal ScrollBar moved. This ScrollBar is used when VIRTUALWIDTH property is used
      [ ONCHANGEVSCROLL cOnChangeVScroll | {BOnChangeVScroll} ]
NIL
  
An action to be performed when the Vertical ScrollBar moved. This ScrollBar is used when VIRTUALHEIGHT property is used
      [ ONMOUSEMOVE cOnMouseMove | {BOnMouseMove} ]
NIL
 
 An action to be performed when the mouse is moved into window.
      [ ONMOVE cOnMove | {BOnMove} ]
NIL
 
 An action to be performed when the window is moved
      [ ONGOTFOCUS cOnGotFocus | {BOnGotFocus} ]
NIL
 
 An action to be performed when the window is focused
      [ ONLOSTFOCUS cOnLostFocus | {BOnLostFocus} ]
NIL
 
 An action to be performed when the window is lost focused
      [ ONINIT cOnInit | {BOnInit} ]
NIL
  
An action to be performed when the window is activated by ACTIVATE method
      [ ONCLOSE cOnClose | {BOnClose} ]
NIL
  
An action to be performed when the window is closed by system menu or system close button
      [ ONRELEASE cOnRelease | {BOnRelease} ]
NIL
  
An action to be performed when the window is released by RELEASE method
      [ ONSIZE cOnSize | {BOnSize} ]
NIL
  
An action to be performed when the window is resized
      [ ONMINIMIZE cOnMinimize | {BOnMinimize} ]
NIL
  
An action to be performed when the window is MINIMIZED (by system menu, system button or method)
      [ ONMAXIMIZE cOnMaximize | {BOnMaximize} ]
NIL
  
An action to be performed when the window is MAXIMIZED (by system menu, system button or method)
      [ ONFULLSCREEN cOnFullScreen | {BOnFullScreen} ]
NIL
  
An action to be performed when the window is FULLSCREEN (by system menu, system button or method)
      [ ONHIDE cOnHide | {BOnHide} ]
NIL
  
An action to be performed when the window is HIDDEN (by system menu, system button or method)
      [ ONRESTORE cOnRestore | {BOnRestore} ]
NIL
  
An action to be performed when the window is RESTORED (by system menu, system button or method)
      [ CONTEXTMENUSUPRESSED .T. | .F. ]
.F.
  
Disable the display of the Context Menu of window.
      [ CREATE CONTEXT MENU [ cName ] ]   
CONTEXT MENU for control
            [ ......... ]   
You can see properties for this menu in CONTEXT MENU topic
      [ END MENU ]   
 
END WINDOW 

Jump to Context Menu topic



Methods


Methods
Status
Default
Planned
Started
Ready
Comments
    ACTIVATE
n/a
  
Activate window
    ONINIT
n/a
  
Execute ONINIT block coded in CREATE or seted by mg_Set
    RELEASE
n/a
  
Release window
    ONRELEASE
n/a
  
Execute ONRELEASE block coded in CREATE or seted by mg_Set
    CENTER
n/a
  
Set window position at center desktop
    MINIMIZE
n/a
  
Minimize window to task bar
    MAXIMIZE
n/a
  
Maximize window in the desktop area
    FULLSCREEN
n/a
  
FullScreen window in the desktop area (without any frame)
    HIDE
n/a
  
Hide window.
    SHOW
n/a
  
Show window. The window must have been previously activated with the ACTIVATE method
    RESTORE
n/a
  
Set window to default size
    GETCHILDREN
n/a
  
This method return an array containing a list of controls that have this window as parent
    GETCONTROLS
n/a
  
This method return an array containing a list of controls that have this window as parent, except those that are not shown on screen (e.g. TIMER or CONTEXTMENU)
    GETBORDERHEIGHT
n/a
  
This method is used to query the height of a window border. Can be used to calculate the full area filled by a window in this way: nFullAreaHeight := mg_do( "win" , "getTitlebarHeight" ) + mg_get( "win" , "height" ) + ( mg_do( "win" , "getBorderHeight" ) * 2 )
Function "getWindowBorderHeight( 'Win' )" does the same job.
    GETBORDERWIDTH
n/a
  
This method is used to query the width of a window border. Can be used to calculate the full area filled by a window in this way: nFullAreaWidth := mg_get( "win" , "width" ) + ( mg_do( "win" , "getBorderWidth" ) * 2 )
Function "getWindowBorderWidth( 'win' )" does the same job.
    GETTITLEBARHEIGHT
n/a
  
This method is used to query the height of a window titlebar. Can be used to calculate the full area filled by a window in this way: nFullAreaHeight := mg_go( "win" , "getTitleBarHeight" ) + mg_get( "win" , "height" ) + ( mg_do( "win" , "getBorderHeight" ) * 2 )
Function "getWindowTitleBarHeight( 'win' )" does the same job.
    UNSETCURSOR
n/a
  
Reset the cursor pointer shape for the window to default (Qt_ArrowCursor). Go to to learn more about it.
    HSCROLLMOVE
n/a
  
Move Horizontal ScrollBar in window with VIRTUALWIDTH property seted
Accepted values are:
Qt_ScrollSingleStepAdd
Qt_ScrollSingleStepSub
Qt_ScrollPageStepAdd
Qt_ScrollPageStepSub
Qt_ScrollToMinimum
Qt_ScrollToMaximum
    VSCROLLMOVE
n/a
  
Move Vertical ScrollBar in window with VIRTUALHEIGHt property seted
Accepted values are:
Qt_ScrollSingleStepAdd
Qt_ScrollSingleStepSub
Qt_ScrollPageStepAdd
Qt_ScrollPageStepSub
Qt_ScrollToMinimum
Qt_ScrollToMaximum
    BRINGTOFRONT
n/a
  
Move window to the top of the parent widget's stack.
    BRINGTOBACK
n/a
  
Move window to the bottom of the parent widget's stack.
    SETFOCUS
n/a
  
This method put the program focus into window
    ONMOUSEMOVE
n/a
  
Execute ONMOUSEMOVE block coded in CREATE or seted by mg_Set
    ONMOVE
n/a
  
Execute ONMOVE block coded in CREATE or seted by mg_Set
    ONSIZE
n/a
  
Execute ONSIZE block coded in CREATE or seted by mg_Set
    ONMINIMIZE
n/a
  
Execute ONMINIMIZE block coded in CREATE or seted by mg_Set
    ONMAXIMIZE
n/a
  
Execute ONMAXIMIZE block coded in CREATE or seted by mg_Set
    ONFULLSCREEN
n/a
  
Execute ONFULLSCREEN block coded in CREATE or seted by mg_Set
    ONHIDE
n/a
  
Execute ONHIDE block coded in CREATE or seted by mg_Set
    ONRESTORE
n/a
  
Execute ONRESTORE block coded in CREATE or seted by mg_Set
    ONCLOSE
n/a
  
Execute ONCLOSE block coded in CREATE or seted by mg_Set
    ONGOTFOCUS
n/a
  
Execute ONGOTFOCUS block coded in CREATE or seted by mg_Set
    ONLOSTFOCUS
n/a
  
Execute ONLOSTFOCUS block coded in CREATE or seted by mg_Set
    ONCHANGEHSCROLL
n/a
  
Execute ONCHANGEHSCROLL block coded in CREATE or seted by mg_Set
    ONCHANGEVSCROLL
n/a
  
Execute ONCHANGEVSCROLL block coded in CREATE or seted by mg_Set




Marinas-GUI Version 03.06 and
Marinas-IDE Version 05.06 and
LEX Files Version 02.06


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
last update: April 27
2017
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




A Harbour/QT framework to make multiplatform programs

(©) Copyright 2009-2017 by Fernando Santolin (aka CarozoDeQuilmes)
CarozoDeQuilmes@gmail.com

2009-2017 Beta tester and full English translator: Bruno Luciani
Bruno.Luciani@gmail.com

2014-2015 Final English corrector: David Worboys
DavidWorboys@hotmail.com

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

www.marinas-gui.org


www.marinas-gui.org  

Previous topic  First topic  Next topic