Navigator
Previous topic  First topic  Next topic





Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE NAVIGATOR cName | (cVarName) | &(cExpression) 
      [ ; OF cWindow | (cVarName) | &(cExpression) ]
Parent.Name
  
A reference to the Parent Window
      [ ROW nRow ]
0
  
Row position on container window in pixels coordinates
      [ COL nCol ]
0
  
Col position on container window in pixels coordinates
      [ WIDTH nWidth ]
?
  
The desired width size of the Control in pixels
      [ HEIGHT nHeight ]
?
  
The desired height size of the Control in pixels
      [ ROWBOTTOM nRow ]
n/a
  
Bottom Row position on container window in pixels coordinates. This property adjust the HEIGHT property according the ROW property.
      [ COLRIGHT nCol ]
n/a
  
Right Col position on container window in pixels coordinates. This property adjust the WIDTH property according the COL property.
      [ ENABLED .T. | .F. ]
.T.
  
Enable or Disable control
      [ URL cUrl ]
NIL
  
URL to navigate
      [ TOOLTIP cToolTip ]
NIL
 
 Text for display into tooltip
      [ NOTABSTOP .T. | .F. ]
.F.
  
This property force that TAB key doesn't stop in this control
      [ PARENT cControlParent ]   
Get or Set the control name of parent widget
      [ PARENTTYPE n/a ]   
Only for mg_get() function, this property returns the PARENT control type or "" if the parent was not set.
      [ HASFOCUS ]   
Only for mg_Get() function. This property returns .T. if control has the application focus
      [ CURSOR ]
Qt_ArrowCursor
  
Change the cursor pointer shape for the control. Go to to learn more about it.
      [ ONCHANGE cOnChange | {BOnChange} ]
NIL
  An action to be performed when control has changed
      [ ONGOTFOCUS cOnGotFocus | {BOnGotFocus} ]
NIL
  
An action to be performed when control is focused
      [ ONLOSTFOCUS cOnLostFocus | {BOnLostFocus} ]
NIL
  
An action to be performed when control is lost focused
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide control (like methods SHOW and HIDE)
      [ 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 NAVIGATOR 

Jump to Context Menu topic



Methods


Methods
Status
Default
Planned
Started
Ready
Comments
    HIDE
n/a
 
 This method HIDE the control
    SHOW
n/a
 
 This method SHOW the control
    UNSETCURSOR
n/a
  
Reset the cursor pointer shape for the control to default (Qt_ArrowCursor). Go to to learn more about it.
    RELEASE
n/a
  
This method is used to destroy the control.
    SETFOCUS
n/a
 
 This method put the program focus into control
    ONCHANGE
n/a
 
 Execute ONCHANGE 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



Example:

File: d_navigator.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 Sample for Web Browser Control"
      ICON "../resource/d_test.ico"
      BACKCOLOR {223,242,253}
      MAIN .T.

      IF !mg_isWebKitModuleDisabled()
         d_navigator_def()
      ELSE
         CREATE LABEL
            ROW 100
            COL 70
            FONTCOLOR {0,0,255}
            FONTBOLD .T.
            FONTSIZE 12
            VALUE "WebKit Module was disabled from Marinas-IDE.  NAVIGATOR control isn't available"
         END LABEL
      ENDIF

   END WINDOW

   mg_Do( "d_window" , "center" )

   mg_Do( "d_window" , "activate" )

Return .T.


File: d_navigator_def.prg

#include "marinas-gui.ch"

Function d_navigator_def()

   CREATE NAVIGATOR Navigator_1
      ROW       10
      COL       40
      if mg_IsControlCreated( "d_window" , "maindemo_tab" )
         WIDTH     mg_Get( "d_window" , "maindemo_tab" , "width" ) - 50
         HEIGHT    ( mg_Get( "d_window" , "maindemo_tab" , "height" ) ) - 90
      else
         WIDTH     mg_Get( "d_window" , "width" ) - 50
         HEIGHT    ( mg_Get( "d_window" , "height" ) ) - 90
      endif
  //  URL "http://www.marinas-gui.org"
      URL "http://www.google.com/search?hl=en&source=hp&q=marinas-gui&btnG=Google+Search&aq=f&aqi=&aql=&oq="
      TOOLTIP "Navigator ToolTip"
  //  ONCHANGE mg_Set( "d_window" , "Navigator_1Image2" , "picture" , "../resource/d_modified.png" )
      ONGOTFOCUS mg_Set( "d_window" , "Navigator_1Image" , "picture" , "../resource/d_focus_on.png" )
      ONLOSTFOCUS mg_Set( "d_window" , "Navigator_1Image" , "picture" , "../resource/d_focus_off.png" )

      CREATE CONTEXT MENU

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

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

      END MENU

   END NAVIGATOR

   CREATE IMAGE Navigator_1Image
      ROW       30
      COL       6
      WIDTH     32
      HEIGHT    32
      PICTURE   "../resource/d_focus_off.png"
      TOOLTIP   "Navigator Focus"
   END IMAGE

   CREATE IMAGE Navigator_1Image2
      ROW       80
      COL       10
      WIDTH     16
      HEIGHT    68
      PICTURE   "../resource/d_original.png"
      TOOLTIP   "Status by OnChange Property/Method"
   END IMAGE

   CREATE TEXTBOX Navigator_TextBox_1
      COL       40
      if mg_IsControlCreated( "d_window" , "maindemo_tab" )
         ROW       ( mg_Get( "d_window" , "maindemo_tab" , "height" ) ) - 70
         WIDTH     mg_Get( "d_window" , "maindemo_tab" , "width" ) - 100
      else
         ROW       ( mg_Get( "d_window" , "height" ) ) - 70
         WIDTH     mg_Get( "d_window" , "width" ) - 100
      endif
      HEIGHT    30
      TOOLTIP "Address to Navigate"
      ONENTER mg_Do( "d_window" , "Navigator_Button_1" , "onclick" )
   END TEXTBOX

   CREATE BUTTON Navigator_Button_1
      if mg_IsControlCreated( "d_window" , "maindemo_tab" )
         ROW       ( mg_Get( "d_window" , "maindemo_tab" , "height" ) ) - 70
         COL       mg_Get( "d_window" , "maindemo_tab" , "width" ) - 50
      else
         ROW       ( mg_Get( "d_window" , "height" ) ) - 70
         COL       mg_Get( "d_window" , "width" ) - 50
      endif
      CAPTION "GO!"
      FONTBOLD .T.
      FONTSIZE 12
      FONTCOLOR {0,0,255}
      WIDTH     40
      HEIGHT    30
      TOOLTIP "Go to new Web Address"
      ONCLICK mg_Set( "d_window" , "Navigator_1" , "url" , mg_Get( "d_window" , "Navigator_TextBox_1" , "value" ) )
   END BUTTON

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