Jump to content

Recommended Posts

Posted

Hi,

I am having a real bad day, the brain is not working... Could you please give me an example script to display a piture, using GUISetControl

:ph34r:

Thanks

Nobby

CheersNobby

Posted

It's all in the helpfile. See Gui Reference. There is an example script with a lot of controls. And you have to use a *.bmp file. No chance for jpeg and gif (I think).

arctor

Posted

yeah...in the helpfile. :ph34r:

FileChangeDir(@ScriptDir)

; Note I did this by hand using relative positioning before I knew any better! - CyberSlug
Opt("GuiCoordMode", 0)

; Start GUI creation
GuiCreate("My GUI", 380, 300)
; will run notepad if F1 is typed,set a default background and change icon
GUICreateEx("notepad",0x00E0FFFF,"autosave.ico")

Global $ACS_AUTOPLAY = 4
GUISetControl( "avi", "inetconnect.avi", 1, 1,-1,-1,$ACS_AUTOPLAY)
    GUISetControl("label", "Sample avi", 1, 40, 70)
GUISetControl( "button", "Button", 1, 40)
GUISetControl( "combo", "", 1, 50)
    GUISetControlData(-1, "Combo", "Combo")
GUISetControl( "date", "", 1, 50, 200)
    GUISetControl("label", "Date control expands in to a calendar...", 1, 30)
    GUISetControlEx(-1,0,0,"",0xff); set text in red
GUISetControl( "edit", "This is an edit control", 1, 30, 200, 50)

Opt("GuiCoordMode", 1); switch to absolute coordinate mode
GUISetControl( "label","", 100, 1, 1, 1)
Opt("GuiCoordMode", 0)

GUISetControl( "input", "Input", -10, 80, 100, 20)

GUISetControl("label", "This is a green label", 1, 50, 100, 20)
    GUISetControlEx(-1, 0, 0, "" ,0, 0x00FF00); backgroun in red

Opt("GuiCoordMode", 1)
GUISetControl( "list","", 200, 1, 120, 60)
    GUISetControlData(-1, "Listbox control|Sample", "Sample")
Opt("GuiCoordMode", 0)

GUISetControl( "progress", "", 1, 50, 120, 20)
    GUISetControlEx (-1, 70)
    GUISetControl("label", "Sample progress", 40, 21)

GUISetControl( "group", "Group", -30, 30, 140, 70)
    GUISetControl( "radio", "Radio One", 10, 20, 80, 20)
    GUISetControl( "radio", "Radio Two", -1, 20, 80, 20)
        GuiSetControlEx(-1, 1);check Radio Two

Opt("GuiCoordMode", 1)
GUISetControl("checkbox", "Checkbox", 250, 270, 100,20)

GUISetControl( "icon","shell32.dll|2", 330, 10)
   GUISetControl("label", "  Icon", 330, 50)
;---------------------- start here -----------------------
GUISetControl( "pic","logo.bmp", 80, 1);<<<<
;---------------------- end here -----------------------
   GUISetControl("label", "Sample pic", 115, 45, 60, 15) 

; start creation of a tab control
GUISetControl("tab", "", 220, 180, 140, 80)
GuiSetControlFont(-1,9,700)  ; to display tab names in bold

; define first tab name
    GUISetControl("tabitem", "One", 1, 60)
     GUISetControl("label", "Sample tab control", 230, 220, 100, 30)

; define second tab name
    GUISetControl("tabitem", "Two...", 1, 60)

; end tab definition
GUISetControl("tabitem", "",0,0)

; display the GUI waiting a close action by default only button close the GUI
GuiShow()
GuiWaitClose()
Posted

Thanks for the replies.

As I said, the brain was not in working mode... It now works.

Cheers

Nobby

CheersNobby

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...