StatusBar
Previous topic  First topic  Next topic





The StatusBar control provides an horizontal bar suitable for presenting status information.

El control StatusBar provee una barra horizontal adecuada para mostrar información de estado de nuestro programa.

Each status indicator falls into one of three categories:
Cada indicador puede ser de alguna de estas categorias:

  • Temporary: briefly occupies most of the status bar. Used to explain tool tip texts or menu entries, for example.
  • Normal: occupies part of the status bar and may be hidden by temporary messages. Used to display the page and line number in a word processor, for example.
  • Permanent: is never hidden. Used for important mode indications, for example, some applications put a Caps Lock indicator in the status bar.
  • .
  • Temporario: ocupa brevemente la mayoria del espacio disponible en la barra de estado. Usado para explicar opciones o items de menues, por ejemplo.
  • Normal: ocupa parte de la barra de estado y es ocultada por los mensages temporarios hasta que estos finalizan. Usado para mostrar el numero de página y linea en un procesador de texto, por ejemplo.
  • Permanente: nunca se oculta. Usado para informacion importante, por ejemplo, algunas aplicaciones lo usan para el indicador de estado de la tecla Caps Lock.
  • .

    StatusBar lets you display all three types of indicators.
    El control StatusBar permite mostrar los tres tipos de mensajes.

    Use the "message" property to display a temporary message:
    Use la propiedad "message" para mostrar un mensage temporario:

    mg_Set( <window_name> , <statusbar_name> , "message" , "new_temporary_message" )

    To remove a temporary message, set a milliseconds time limit by using the "messageTime" property before set message.
    For example, to set message timeout to 1 second:

    Para remover un mensage temporario, establezca un valor en milisegundos usando la propiedad "messageTime" antes de mostrar el mensage. Por ejemplo, para establecer la duración del mensaje en 1 segundo:

    mg_Set( <window_name> , <statusbar_name> , "messageTime" , 1000 )

    mg_Set( <window_name> , <statusbar_name> , "message" , "new_temporary_message" )

    Normal (Default) and Permanent messages are displayed by creating a small control (Label, ProgressBar or even CheckBox) into StatusBar create command or by adding it to the status bar using the "addItem" method.

    Mensajes Normal (Default) y Permanente son mostrados mediante pequeños controles (Label, ProgressBar, o incluso CheckBox) creados dentro de los comandos de creación de la StatusBar o agregando el control mediante el método "addItem".

    mg_Do( <window_name> , <statusbar_name> , "addItem" , <control_name> [ , <nPosition> ] )

    To change Normal message to Permanent message, use the "Permanent" property

    Para cambiar un control de Normal a Permanente, se debe usar la propiedad "Permanent"

    By default, StatusBar provides a size control in the lower-right corner. You can disable it using the "DisableSizeGrip" property.
    Por Default, la StatusBar provee un control de tamaño en la esquina inferior derecha. Usted puede desabilitar dicho control mediante la propiedad "DisableSizeGrip"

    NOTE: Depending on the keyboard is used, it may be that some operating systems do not recognize the keys that monitors the statusbar by default (you can exclude it using the property DISABLExxx. T. (xxx can be CAPS, NUM, SCROLL, INS or AllKEYS ))
    NOTA: dependiendo del teclado que se utilice, puede ser que algunos sistemas operativos no reconozcan las teclas que la statusbar monitorea por default (se pueden excluir con la propiedad DISABLExxx .T. (donde xxx puede ser CAPS, NUM, SCROLL, INS o ALLKEYS))

    e.g:
    CREATE STATUSBAR
       DISABLESCROLL .T.
    END STATUSBAR


    Neider Harbour nor Qt have not implemented the ease of detecting these keys on all platforms. Marinas-GUI uses the CT contributions library of Harbour for Windows, and for Linux use the code found here: keystate sample for x11
    Ni harbour ni Qt tienen implementada la facilidad de detección de estas teclas en todas las plataformas. Marinas-GUI utiliza la libreria CT de las contribuciones de Harbour para el sistema operativo Windows y para Linux utiliza el código que se encuentra aqui: ejemplo keystate para sistemas operativos basados en x11

    Additionally, in Linux you can read more about this in the help of command: xmodmap
    Adicionalmente, en Linux puede leer mas sobre este tema en la ayuda del comando xmodmap



    Define and Properties


    Properties
    Status
    Default
    Planned
    Started
    Ready
    Comments
    CREATE STATUSBAR cName | (cVarName) | &(cExpression) 
          [ MESSAGE cMessage ]
    NIL
      
    A text expressions for the TEMPORARY message. This message briefly occupies most of the status bar. Used to explain tool tip texts or menu entries, for example.
          [ MESSAGETIME nMilliSeconds ]
    NIL
      
    Set a time limit when sending message. When time is reached, message will be hidden.
          [ 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 control text
          [ FONTSIZE nPoints ]
    Parent.FontSize
      
    Font size for control text
          [ FONTBOLD .T. | .F. ]
    .F.
      
    Set Bold attribute to control text
          [ FONTITALIC .T. | .F. ]
    .F.
      
    Set Italic attribute to control text
          [ FONTUNDERLINE .T. | .F. ]
    .F.
      
    Set Underline attribute to control text
          [ FONTSTRIKEOUT .T. | .F. ]
    .F.
      
    Set Strikeout attribute to control text
          [ WIDTH ]   
    Only for mg_Get() function. The desired width size of the Control in pixels
          [ HEIGHT ]   
    Only for mg_Get() function. The desired height size of the Control in pixels
          [ CLOCKAMPM .T. | .F. ]
    .F.
      
    Set CLOCK display mode to AM-PM. E.g.: 04:26:57 am
          [ DISABLECLOCK .T. | .F. ]
    .F.
      
    Remove CLOCK from StatusBar
          [ DISABLEDATE .T. | .F. ]
    .F.
      
    Remove DATE from StatusBar
          [ DISABLECAPS .T. | .F. ]
    .F.
      
    Remove CAPSLOCK state from StatusBar
          [ DISABLENUM .T. | .F. ]
    .F.
      
    Remove NUMLOCK state from StatusBar
          [ DISABLESCROLL .T. | .F. ]
    .F.
      
    Remove SCROLLLOCK state from StatusBar
          [ DISABLEINS .T. | .F. ]
    .F.
      
    Remove INSert key state from StatusBar
          [ DISABLEALLKEYS .T. | .F. ]
    .F.
      
    Remove CAPSLOCK, NUMLOCK, SCROLLLOCK and INSert keys from StatusBar
          [ DISABLESIZEGRIP .T. | .F. ]
    .F.
      
    By default, StatusBar provides a SizeGrip in the lower-right corner. You can disable it using this property.
          [ DISABLELANGUAGE .T. | .F. ]
    .F.
      
    Show/Hide "LANGUAGE code" from StatusBar
          [ DISABLECODEPAGE .T. | .F. ]
    .F.
      
    Show/Hide CODEPAGE from StatusBar
          [ TOOLTIP cToolTip ]
    NIL
      
    Text for display into tooltip
          [ CURSOR ]
    Qt_ArrowCursor
      
    Change the cursor pointer shape for the control. Go to to learn more about it.
          [ 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 STATUSBAR 

    Jump to Context Menu topic



    Methods


    Methods
    Status
    Default
    Planned
    Started
    Ready
    Comments
        ADDITEM cItemName [ , nPosition ]
    n/a
      
    Add or Insert a new item (control pre defined) to StatusBar control. Normal controls will be added to the left side and PERMANENT controls will be added to right side. If nPosition is present, new item will be added to right previous nPosition item.
        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)
        GETCAPSCONTROLNAME
    n/a
      
    This method will be use to GET the name of control used to show CAPSLOCK key state. You can use it to change control's attributes, e.g. backcolor: mg_Set( <win_name> , mg_Do( <win_name> , <statusbar_name> , "GETCAPSCONTROLNAME" ) , "backcolor" , {255,0,0} )
        GETNUMCONTROLNAME
    n/a
      
    This method will be use to GET the name of control used to show NUMLOCK key state. You can use it to change control's attributes, e.g. backcolor: mg_Set( <win_name> , mg_Do( <win_name> , <statusbar_name> , "GETNUMCONTROLNAME" ) , "backcolor" , {255,0,0} )
        GETSCROLLCONTROLNAME
    n/a
      
    This method will be use to GET the name of control used to show SCROLLLOCK key state. You can use it to change control's attributes, e.g. backcolor: mg_Set( <win_name> , mg_Do( <win_name> , <statusbar_name> , "GETSCROLLCONTROLNAME" ) , "backcolor" , {255,0,0} )
        GETINSCONTROLNAME
    n/a
      
    This method will be use to GET the name of control used to show INSERT key state. You can use it to change control's attributes, e.g. backcolor: mg_Set( <win_name> , mg_Do( <win_name> , <statusbar_name> , "GETINSCONTROLNAME" ) , "backcolor" , {255,0,0} )
        GETCLOCKCONTROLNAME
    n/a
      
    This method will be use to GET the name of control used to show CLOCK. You can use it to change control's attributes, e.g. backcolor: mg_Set( <win_name> , mg_Do( <win_name> , <statusbar_name> , "GETCLOCKCONTROLNAME" ) , "backcolor" , {255,0,0} )
        GETDATECONTROLNAME
    n/a
      
    This method will be use to GET the name of control used to show DATE. You can use it to change control's attributes, e.g. backcolor: mg_Set( <win_name> , mg_Do( <win_name> , <statusbar_name> , "GETDATECONTROLNAME" ) , "backcolor" , {255,0,0} )
        GETCODEPAGECONTROLNAME
    n/a
      
    This method will be use to GET the name of control used to show CODEPAGE. You can use it to change control's attributes, e.g. backcolor: mg_Set( <win_name> , mg_Do( <win_name> , <statusbar_name> , "GETCODEPAGECONTROLNAME" ) , "backcolor" , {255,0,0} )
        GETLANGUAGECONTROLNAME
    n/a
      
    This method will be use to GET the name of control used to show LANGUAGE. You can use it to change control's attributes, e.g. backcolor: mg_Set( <win_name> , mg_Do( <win_name> , <statusbar_name> , "GETLANGUAGECONTROLNAME" ) , "backcolor" , {255,0,0} )



    Example:

    File: d_statusbar.prg


    #include "marinas-gui.ch"

    Function Main

       SET APPLSTYLE TO "MarinasLooks"

       CREATE WINDOW d_window
          ROW 0
          COL 0
          WIDTH 820 ; HEIGHT 130
          CAPTION "Marinas-GUI Demo StatusBar Control"
          ICON "../resource/d_test.ico"
          MAIN .T.
    //    ONINIT {|| mg_SaveScreen( "d_window" , "../doc/d_statusbar.png" ) }

          d_statusbar_def()

          CREATE LABEL Label133
             ROW 40
             COL 190
             VALUE "This is only a sample for StatusBar control"
             FONTSIZE 16
             FONTCOLOR { 200 , 200 , 200 }
             FONTBOLD .T.
             FONTITALIC .F.
             AUTOSIZE .T.
          END LABEL

       END WINDOW

       mg_Do( "d_window" , "center" )

       mg_Do( "d_window" , "activate" )

    Return Nil


    File: d_statusbar_def.prg

    #include "marinas-gui.ch"

    Function d_statusbar_def()

       CREATE STATUSBAR StatusBar_1
          TOOLTIP "StatusBar ToolTip"
       // DISABLECLOCK .T.
       // DISABLEDATE .T.
       // DISABLEALLKEYS .T.
          MESSAGETIME 2000
          FONTCOLOR {255,0,0}
          CLOCKAMPM .T.

          CREATE LABEL StatusBar_Label1
             VALUE "  Marinas-GUI StatusBar Ready !!!  "
             FONTCOLOR {0,0,255}
             FONTITALIC .T.
             PERMANENT .F.
          END LABEL

          CREATE CONTEXT MENU

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

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

          END MENU

       END STATUSBAR

    Return .T.
    



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


    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    last update: March 09
    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

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


    Jump to Donation Topic


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

    www.marinas-gui.org


    www.marinas-gui.org  

    Previous topic  First topic  Next topic