ScrollArea
Previous topic  First topic  Next topic





Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE SCROLLAREA cName | (cVarName) | &(cExpression) 
      [ PARENT cParentName ]
NIL
  
Parent window for this widget
      [ 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 ]
nWidth
  
The desired virtual width size of the scrollarea in pixels. This property must be greater than WIDTH property
      [ VIRTUALHEIGHT nVirtualHeight ]
nHeight
  
The desired virtual height size of the scrollarea in pixels. This property must be greater than HEIGHT property
      [ 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 ]
scrollarea.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 ]
scrollarea.VIRTUALHEIGHT
  
This property is used to get/set the maximum value for the vertical scrollbar. This ScrollBar is used when VIRTUALHEIGHT property is used.
      [ HASFOCUS ]   
Only for mg_Get() function. This property returns .T. if scrollarea has the application focus
      [ CURSOR ]
Qt_ArrowCursor
  
Change the cursor pointer shape for the scrollarea. Go to to learn more about it.
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
      [ ENABLED .T. | .F. ]
.T.
  
Enable or Disable ALL controls in scrollarea
      [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide scrollarea (like methods SHOW and HIDE)
      [ 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
      [ ONGOTFOCUS cOnGotFocus | {BOnGotFocus} ]
NIL
  
An action to be performed when the scrollarea is focused
      [ ONLOSTFOCUS cOnLostFocus | {BOnLostFocus} ]
NIL
  
An action to be performed when the scrollarea is lost focused
      [ CONTEXTMENUSUPRESSED .T. | .F. ]
.F.
  
Disable the display of the Context Menu of control.
      [ CREATE CONTEXT MENU [ cName ] ]   
CONTEXT MENU for control
            [ ......... ]   
You can see properties for this menu in CONTEXT MENU topic
      [ END MENU ]   
 
END SCROLLAREA 

Jump to Context Menu topic



Methods


Methods
Status
Default
Planned
Started
Ready
Comments
    RELEASE
n/a
  
Release scrollarea
    HIDE
n/a
  
Hide scrollarea.
    SHOW
n/a
  
Show scrollarea.
    ADDCONTROL cControlName [ , nRow ] [ , nCol ]
n/a
  
This method ADD a previously created control in the SCROLLAREA, optionally, you can specify the row and col position into the SCROLLAREA.
    UNSETCURSOR
n/a
  
Reset the cursor pointer shape for the scrollarea to default (Qt_ArrowCursor). Go to to learn more about it.
    HSCROLLMOVE
n/a
  
Move Horizontal ScrollBar in scrollarea 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 scrollarea with VIRTUALHEIGHt property seted
Accepted values are:
Qt_ScrollSingleStepAdd
Qt_ScrollSingleStepSub
Qt_ScrollPageStepAdd
Qt_ScrollPageStepSub
Qt_ScrollToMinimum
Qt_ScrollToMaximum
    SETFOCUS
n/a
  
This method put the program focus into scrollarea
    GETCHILDREN
n/a
  
This method return an array containing a list of controls that have this control as parent
    GETCONTROLS
n/a
  
This method return an array containing a list of controls that have this control as parent, except those that are not shown on screen (e.g. TIMER or CONTEXTMENU)
    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



Example:

File: d_scrollarea.prg


#include "marinas-gui.ch"

Function Main

   SET APPLSTYLE TO "MarinasLooks"

   CREATE WINDOW d_window
      ROW 0
      COL 0
      WIDTH 820 ; HEIGHT 480
      CAPTION "Marinas-GUI Demo ScrollArea Control"
      ICON "../resource/d_test.ico"
      MAIN .T.

      d_scrollarea_def()

   END WINDOW

   mg_Do( "d_window" , "center" )
   mg_Do( "d_window" , "activate" )

Return Nil


File: d_scrollarea_def.prg

#include "marinas-gui.ch"

Function d_scrollarea_def()

   CREATE IMAGE scrollArea_image
      ROW       45
      COL       60
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_focus_off.png"
      TOOLTIP   "ScrollArea Focus"
   END IMAGE

   CREATE LABEL SC_Label1
      ROW    10
      COL    20
      WIDTH  350
      HEIGHT 24
      VALUE "Label outside of ScrollArea"
   END LABEL

   CREATE SCROLLAREA ScrollArea1
      BACKCOLOR {255,0,0}
      ROW 45
      COL 100
      WIDTH 620
      VIRTUALWIDTH 820
      HEIGHT 400
      VIRTUALHEIGHT 600
   // HSCROLL Qt_ScrollBarAlwaysOff         // Visibility of Horizontal ScrollBar
      ONCHANGEVSCROLL mg_set( "d_window" , "SC_Label1" , "value" , "Vertical Scroll at " + mg_allStr( seconds() ) + " seconds" )
      ONGOTFOCUS mg_Set( "d_window" , "scrollArea_image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "scrollArea_image" , "picture" , "../resource/d_focus_off.png" )

      CREATE BUTTON SC_ButtonOutTab
         ROW    35
         COL    10
         WIDTH  80
         HEIGHT 60
         CAPTION "Children"
         ONCLICK mg_log( mg_do( "d_window" , "ScrollArea1" , "getChildren" ) )
         TOOLTIP "Press this button to get controls that has the scrollArea as parent"
      END BUTTON

      CREATE RADIOGROUP SC_radio_1
         FONTCOLOR {255,255,255}
         COL    10
         ITEMS {'Alpa' , 'Beta' , 'Gamma' }
         VALUE 2
         FONTNAME "mg_monospace"
         VSPACING  10
         FONTSIZE 14
         FONTITALIC .T.
         ROW    180
         TOOLTIP "RadioGroup ToolTip"
      END RADIOGROUP

      CREATE TAB SCTab1A
         ROW 15
         COL 100
         WIDTH 620
         HEIGHT 460
         VALUE 1
         FONTSIZE 9
         FONTITALIC .T.
         TOOLTIP "Tab Tooltip"

         CREATE CONTEXT MENU

            CREATE ITEM "Item 1 from Tab"
               ONCLICK { || mg_MsgInfo( "Item 1 from Tab" ) }
               PICTURE "../resource/d_test.png"
            END ITEM

            CREATE ITEM "Item 2 from Tab"
               ONCLICK { || mg_MsgInfo( "Item 2 from Tab" ) }
               PICTURE "../resource/d_test.png"
            END ITEM

         END MENU

         CREATE PAGE "SCTab1A Page1"

            CREATE LABEL SCTab1A_Page1_Label1
                   ROW    70
                   COL    40
                   WIDTH  150
                   HEIGHT 24
                   VALUE "SCTab1A_Page1_Label1"
            END LABEL

            CREATE BUTTON SCTab1A_Page1_Button1
                  ROW    130
                  COL    40
                  AUTOSIZE .T.
                  CAPTION "SCTab1A_Page1_Button1"
                  ONCLICK mg_MsgInfo( "Click from SCTab1A_Page1_Button1" )

                  CREATE CONTEXT MENU

                     CREATE ITEM "Item 1 from Button in Page"
                        ONCLICK { || mg_MsgInfo( "Item 1 from Button in Page" ) }
                        PICTURE "../resource/d_test.png"
                     END ITEM

                     CREATE ITEM "Item 2 from Button in Page"
                        ONCLICK { || mg_MsgInfo( "Item 2 from Button in Page" ) }
                        PICTURE "../resource/d_test.png"
                     END ITEM

                  END MENU

            END BUTTON

            CREATE CONTEXT MENU

               CREATE ITEM "Item 1 from Page"
                  ONCLICK { || mg_MsgInfo( "Item 1 from Page" ) }
                  PICTURE "../resource/d_test.png"
               END ITEM

               CREATE ITEM "Item 2 from Page"
                  ONCLICK { || mg_MsgInfo( "Item 2 from Page" ) }
                  PICTURE "../resource/d_test.png"
               END ITEM

            END MENU

            CREATE RADIOGROUP SC_radio_2
               FONTCOLOR {0,119,60}
               COL    10
               ITEMS {'One' , 'Two' , 'Tree' }
               VALUE 2
               FONTNAME "mg_monospace"
               VSPACING  10
               FONTSIZE 14
               FONTITALIC .T.
               ROW    180
               TOOLTIP "RadioGroup ToolTip"
               HORIZONTAL .T.
            END RADIOGROUP

            CREATE SCROLLAREA SC_2
               ROW    10
               COL    300
               WIDTH  140
               VIRTUALWIDTH  340
               HEIGHT 300
               VIRTUALHEIGHT 400
               BACKCOLOR {0,0,255}

               CREATE BUTTON SCTab1A_Page1_Button0
                  ROW    10
                  COL    10
                  WIDTH  240
                  HEIGHT 25
                  CAPTION "SCTab1A_Page1_Button0"
                  ONCLICK mg_MsgInfo( "Click from SCTab1A_Page1_Button0" )
               END BUTTON

               CREATE IMAGE SC_Image_1
                  ROW    80
                  COL    12
                  WIDTH  300
                  HEIGHT 300
                  BACKCOLOR {155,0,0}
                  ALIGN Qt_AlignCenter
                  PICTURE "../resource/argentina_in_motorcycle.png"
                  ONCLICK {|| mg_Log( "IMAGE Clicked !!!" )}

                  CREATE CONTEXT MENU

                     CREATE ITEM "Item 1 from Image"
                        ONCLICK { || mg_MsgInfo( "Item 1 from Image" ) }
                        PICTURE "../resource/d_test.png"
                     END ITEM

                     CREATE ITEM "Item 2 from Image"
                        ONCLICK { || mg_MsgInfo( "Item 2 from Image" ) }
                        PICTURE "../resource/d_test.png"
                     END ITEM

                  END MENU

               END IMAGE

            END SCROLLAREA

         END PAGE

         CREATE PAGE "SCTab1A Page2"
            PICTURE '../resource/d_test.png'

            CREATE LABEL SCTab1A_Page2_Label1
                   ROW    90
                   COL    110
                   WIDTH  150
                   HEIGHT 24
                   VALUE "SCTab1A_Page2_Label1"
            END LABEL

            CREATE BUTTON SCTab1A_Page2_Button1
                   ROW    150
                   COL    110
                   WIDTH  140
                   HEIGHT 25
                   CAPTION "SCTab1A_Page2_Button1"
                   ONCLICK mg_MsgInfo( "Click from SCTab1A_Page2_Button1" )
            END BUTTON

         END PAGE

         CREATE PAGE "SCTab1A Page3"

            CREATE LABEL SCTab1A_Page3_Label1
                   ROW    190
                   COL    200
                   WIDTH  150
                   HEIGHT 24
                   VALUE "SCTab1A_Page3_Label1"
            END LABEL

            CREATE BUTTON SCTab1A_Page3_Button1
                   ROW    235
                   COL    200
                   WIDTH  140
                   HEIGHT 27
                   CAPTION "SCTab1A_Page2_Button1"
                   ONCLICK mg_MsgInfo( "Click from SCTab1A_Page2_Button1" )
            END BUTTON

         END PAGE

         CREATE PAGE "SCTab1A Page4"
            PICTURE '../resource/d_test.png'

            CREATE LABEL SCTab1A_Page4_Label1
                   ROW    190
                   COL    10
                   WIDTH  150
                   HEIGHT 24
                   VALUE "SCTab1A_Page1_Label1"
            END LABEL

            CREATE BUTTON SCTab1A_Page4_Button1
                   ROW    230
                   COL    10
                   WIDTH  140
                   HEIGHT 25
                   CAPTION "SCTab1A_Page4_Button1"
                   ONCLICK mg_MsgInfo( "Click from SCTab1A_Page4_Button1" )
            END BUTTON

         END PAGE

         CREATE PAGE "SCTab1A Page5 MultiTab"

            CREATE TAB SCTab2A
               ROW 15
               COL 10
               WIDTH 600
               HEIGHT 410
               VALUE 3
               FONTNAME "mg_monospace"
               FONTSIZE 12
               TOOLTIP "Tab2 Tooltip"

               CREATE PAGE "SCTab2A Page1"

                  CREATE LABEL SCTab2A_Page1_Label1
                         ROW    100
                         COL    10
                         WIDTH  200
                         HEIGHT 24
                         VALUE "Label SCTab2 Page 1"
                  END LABEL

                  CREATE BUTTON SCTab2A_Page1_Button1
                         ROW    140
                         COL    10
                         AUTOSIZE .T.
                         CAPTION "SCTab2A_Page1_Button1"
                         ONCLICK mg_MsgInfo( "Click from SCTab2A_Page1_Button1" )
                  END BUTTON

               END PAGE

               CREATE PAGE "SCTab2A Page2"
                  PICTURE '../resource/d_test.png'

                  CREATE TAB SCTab3A
                     ROW 15
                     COL 10
                     WIDTH 290
                     HEIGHT 355
                     VALUE 3
                     BACKCOLOR {0,0,255}
                     FONTSIZE 10
                     TOOLTIP "Tab3 Tooltip"

                     CREATE PAGE "SCTab3A Page1"

                        CREATE LABEL SCTab3A_Page1_Label1
                               ROW    100
                               COL    10
                               WIDTH  200
                               HEIGHT 24
                               VALUE "SCTab3A_Page1_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON SCTab3A_Page1_Button1
                               ROW    140
                               COL    10
                               AUTOSIZE .T.
                               CAPTION "SCTab3A_Page1_Button1"
                               ONCLICK mg_MsgInfo( "Click from SCTab3A_Page1_Button1" )
                        END BUTTON

                     END PAGE

                     CREATE PAGE "SCTab3A Page2"
                        PICTURE '../resource/d_test.png'

                        CREATE LABEL SCTab3A_Page2_Label1
                               ROW    100
                               COL    100
                               AUTOSIZE .T.
                               VALUE "SCTab3A_Page2_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON SCTab3A_Page2_Button1
                               ROW    140
                               COL    60
                               WIDTH  200
                               HEIGHT 25
                               CAPTION "SCTab3A_Page2_Button1"
                               ONCLICK mg_MsgInfo( "Click from SCTab3A_Page2_Button1" )
                        END BUTTON

                     END PAGE

                     CREATE PAGE "SCTab3A Page3"
                        PICTURE '../resource/d_test.png'

                        CREATE LABEL SCTab3A_Page3_Label1
                               ROW    80
                               COL    110
                               AUTOSIZE .T.
                               VALUE "SCTab3A_Page3_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON SCTab3A_Page3_Button1
                               ROW    120
                               COL    70
                               WIDTH  200
                               HEIGHT 25
                               CAPTION "SCTab3A_Page3_Button1"
                               ONCLICK mg_MsgInfo( "Click from SCTab3A_Page3_Button1" )
                        END BUTTON

                     END PAGE

                     CREATE PAGE "SCTab3A Page4"
                        PICTURE '../resource/d_test.png'

                        CREATE LABEL SCTab3A_Page4_Label1
                               ROW    70
                               COL    120
                               AUTOSIZE .T.
                               VALUE "SCTab3A_Page4_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON SCTab3A_Page4_Button1
                               ROW    110
                               COL    30
                               WIDTH  200
                               HEIGHT 25
                               CAPTION "SCTab3A_Page4_Button1"
                               ONCLICK mg_MsgInfo( "Click from SCTab3A_Page4_Button1" )
                        END BUTTON

                     END PAGE

                  END TAB

                  CREATE TAB SCTab3B
                     ROW 15
                     COL 310
                     WIDTH 280
                     HEIGHT 355
                     VALUE 3
                     BACKCOLOR {255,0,0}
                     FONTSIZE 10
                     TOOLTIP "Tab3B Tooltip"

                     CREATE PAGE "SCTab3B Page1"

                        CREATE LABEL SCTab3B_Page1_Label1
                               ROW    100
                               COL    10
                               WIDTH  200
                               HEIGHT 24
                               VALUE "SCTab3B_Page1_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON SCTab3B_Page1_Button1
                               ROW    140
                               COL    10
                               AUTOSIZE .T.
                               CAPTION "SCTab3B_Page1_Button1"
                               ONCLICK mg_MsgInfo( "Click from SCTab3B_Page1_Button1" )
                        END BUTTON

                     END PAGE

                     CREATE PAGE "SCTab3B Page2"
                        PICTURE '../resource/d_test.png'

                        CREATE LABEL SCTab3B_Page2_Label1
                               ROW    100
                               COL    100
                               AUTOSIZE .T.
                               VALUE "SCTab3B_Page2_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON SCTab3B_Page2_Button1
                               ROW    140
                               COL    80
                               WIDTH  180
                               HEIGHT 25
                               CAPTION "SCTab3B_Page2_Button1"
                               ONCLICK mg_MsgInfo( "Click from SCTab3B_Page2_Button1" )
                        END BUTTON

                     END PAGE

                     CREATE PAGE "SCTab3B Page3"
                        PICTURE '../resource/d_test.png'

                        CREATE LABEL SCTab3B_Page3_Label1
                               ROW    80
                               COL    110
                               AUTOSIZE .T.
                               VALUE "SCTab3B_Page3_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON SCTab3B_Page3_Button1
                               ROW    120
                               COL    60
                               WIDTH  180
                               HEIGHT 25
                               CAPTION "SCTab3B_Page3_Button1"
                               ONCLICK mg_MsgInfo( "Click from SCTab3B_Page3_Button1" )
                        END BUTTON

                     END PAGE

                     CREATE PAGE "SCTab3B Page4"
                        PICTURE '../resource/d_test.png'

                        CREATE LABEL SCTab3B_Page4_Label1
                               ROW    70
                               COL    120
                               AUTOSIZE .T.
                               VALUE "SCTab3B_Page4_Label1"
                               FONTCOLOR {255,255,255}
                               FONTBOLD .T.
                        END LABEL

                        CREATE BUTTON SCTab3B_Page4_Button1
                               ROW    110
                               COL    20
                               WIDTH  200
                               HEIGHT 25
                               CAPTION "SCTab3B_Page4_Button1"
                               ONCLICK mg_MsgInfo( "Click from SCTab3B_Page4_Button1" )
                        END BUTTON

                     END PAGE

                  END TAB

               END PAGE

            END TAB

         END PAGE

      END TAB

   END SCROLLAREA

   mg_Set( "d_window" , "SCTab2A" , "value" , 2 )

   mg_Set( "d_window" , "SCTab3A" , "value" , 3 )

RETURN .T.




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