Image
Previous topic  First topic  Next topic





Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE IMAGE 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.
      [ AUTOSIZE .T. | .F. ]
.F.
  
Auto adjust control size to image
      [ PICTURE "cPictureName" ]
NIL
  
Picture name for display into control
      [ ENABLED .T. | .F. ]
.T.
  
Enable or Disable control
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
      [ TOOLTIP cToolTip ]
NIL
  
Text for display into tooltip
      [ OPAQUE .T. | .F. ]
.F.
  ?
      [ STRETCH .T. | .F. ]
.F.
  
The image is going to resize to the control size (ignore AspectRatio)
      [ SCALED .T. | .F. ]
.F.
  
The image is going to resize to the control size (keep AspectRatio). In a PRINT REPORT control, it is the default and you don't need to coded it.
      [ ALIGN nAlign ]
Qt_AlignLeft
  
Align text, most common value are Qt_AlignLeft , Qt_AlignCenter and Qt_AlignRight
      [ TRANSPARENT .T. | .F. ]
.F.
  ?
      [ NOTABSTOP .T. | .F. ]
.F.
  
This property force that TAB key doesn't stop in this control
      [ PERMANENT .T. | .F. ]
.F.
  
Only for controls defined into STATUSBAR. This property force this control as permanent statusbar message. Control will be placed at right corner of statusbar and it is never hidden. Used for important mode indications, for example, some applications put a Caps Lock indicator in the status bar.
      [ VISIBLE .T. | .F. ]
.T.
  
Show or hide control (like methods SHOW and HIDE)
      [ CURSOR ]
Qt_ArrowCursor
  
Change the cursor pointer shape for the control. Go to to learn more about it.
      [ 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.
      [ FORCEACTION .T. | .F. ]
.F.
  
It force the execution of the actions defined by methods like ACTION, ONENTER, ONCLICK, ONDBLCLICK, etc. when NOTABSTOP property was set '.T.'. This property is useful when application focus is over a control when a VALID clause and it doesn't permit lostfocus.
      [ ONCLICK cOnClick | {BOnClick} ]
NIL
  
An action to be performed when control is clicking
      [ 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 IMAGE 

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.
    SAVETOFILE cFileName
n/a
  
This method is used to save image to file. The image file type will be chosen from fileName's suffix. Default image type is 'png'
    ONCLICK
n/a
 
 Execute ONCLICK block coded in CREATE or seted by mg_Set
    SETFOCUS
n/a
 
 This method put the program focus into control
    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_image.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 Image Control"
      ICON "../resource/d_test.ico"
      BACKCOLOR {216,237,236}
      MAIN .T.

      d_image_def()

   END WINDOW

   mg_Do( "d_window" , "center" )

   mg_Do( "d_window" , "activate" )

Return .T.


File: d_image_def.prg

#include "marinas-gui.ch"

Function d_image_def()

     CREATE LABEL Image_Label_1
            ROW    17
            COL    135
            WIDTH  570
            HEIGHT 23
            VALUE "For make this sample, we going to use only one image with diferents properties"
            FONTSIZE 11
            FONTCOLOR {27,9,185}
     END LABEL

     CREATE LABEL Image_Label_2
            ROW    50
            COL    340
            WIDTH  160
            HEIGHT 24
            VALUE "Real size: 270 x 200"
            FONTBOLD .T.
            FONTCOLOR {206,0,0}
     END LABEL

     CREATE FRAMEBOX Image_FrameBox_1
            ROW    90
            COL    110
            WIDTH  319
            HEIGHT 331
            CAPTION "300 x 300 with BACKCOLOR and ALIGN CENTER"
     END FRAMEBOX

     CREATE IMAGE Image_1
            ROW    110
            COL    120
            WIDTH  300
            HEIGHT 300
            BACKCOLOR {155,0,0}
            ALIGN Qt_AlignCenter
            PICTURE "../resource/argentina_in_motorcycle.png"
            ONCLICK {|| mg_msgInfo( "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

     CREATE FRAMEBOX Image_FrameBox_2
            ROW    90
            COL    460
            WIDTH  120
            HEIGHT 132
            FONTSIZE 8
            CAPTION "100 x 100"
     END FRAMEBOX

     CREATE IMAGE Image_2
            ROW    110
            COL    470
            WIDTH  100
            HEIGHT 100
            PICTURE "../resource/argentina_in_motorcycle.jpg"
            ONCLICK {|| mg_msgInfo( "IMAGE Clicked !!!" )}
    END IMAGE

     CREATE FRAMEBOX Image_FrameBox_3
            ROW    290
            COL    460
            WIDTH  120
            HEIGHT 132
            FONTSIZE 8
            CAPTION "100 x 100 SCALED"
     END FRAMEBOX

     CREATE IMAGE Image_3
            ROW    310
            COL    470
            WIDTH  100
            HEIGHT 100
            SCALED .T.
            PICTURE "../resource/argentina_in_motorcycle.png"
            ONCLICK {|| mg_msgInfo( "IMAGE Clicked !!!" )}
            BACKCOLOR {0,0,255}
    END IMAGE

     CREATE FRAMEBOX Image_FrameBox_4
            ROW    90
            COL    600
            WIDTH  98
            HEIGHT 331
            CAPTION "Stretch"
     END FRAMEBOX

     CREATE IMAGE Image_4
            ROW    110
            COL    610
            WIDTH  78
            HEIGHT 295
            STRETCH .T.
            PICTURE "../resource/argentina_in_motorcycle.png"
            ONCLICK {|| mg_msgInfo( "IMAGE Clicked !!!" )}
    END IMAGE

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