Jump to content

Recommended Posts

Posted

now YOU guys make some stuff

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

  • 2 weeks later...
Posted

just playing around with the idea some more.

Dim $W_HEIGHT = 255, $W_WIDTH = 500, $TITLE = "Another Edge Demo"

;==================================================================
; create the Main window
;==================================================================
$MAIN_WINDOW = GUICreate($TITLE, $W_WIDTH, $W_HEIGHT)

#Region --- CFCCodeWizard generated code Start ---
If Not IsDeclared('Silver') Then Global Const $Silver = 0xC0C0C0
GUISetBkColor($Silver)
#EndRegion --- CFCCodeWizard generated code End ---

If Not IsDeclared('Red') Then Dim $Red = 0xff0000
_GUICreateEdgeInsideBorder(0,0,4,$W_WIDTH,$W_HEIGHT,$Red)

If Not IsDeclared('Black') Then Global Const $Black = 0x000000
$BUTTON_1 = _GUICtrlCreateEdgeButton("A Button", 70, $W_HEIGHT - 40, 2, 120, 25,$Black)
$EXIT = _GUICtrlCreateEdgeButton("E&xit", 310, $W_HEIGHT - 40, 3, 120, 25,$Black)

;==================================================================
; create the tab control
;==================================================================
$TAB = GUICtrlCreateTab(10, 10, $W_WIDTH - 20, $W_HEIGHT - 70)

If Not IsDeclared('Blue') Then Global Const $Blue = 0x0000ff
_GUICreateEdgeOutSideBorder(10,10,3,$W_WIDTH - 20,$W_HEIGHT - 70,$Blue)

;==================================================================
; create a tab
;==================================================================
$TABItem1 = GUICtrlCreateTabItem("test tab")
GUICtrlCreateTabitem ("")  ; end tabitem definition
;==================================================================
; create a tab
;==================================================================
$TABItem2 = GUICtrlCreateTabItem("test tab 2")
GUICtrlCreateTabitem ("")  ; end tabitem definition

;==================================================================
; create a tab
;==================================================================
$TABItem3 = GUICtrlCreateTabItem("test tab 3")
GUICtrlCreateTabitem ("")  ; end tabitem definition

;==================================================================
; create a tab
;==================================================================
$TABItem4 = GUICtrlCreateTabItem("test tab 4")
GUICtrlCreateTabitem ("")  ; end tabitem definition

;==================================================================
; create a tab
;==================================================================
$TABItem5 = GUICtrlCreateTabItem("test tab 5")
GUICtrlCreateTabitem ("")  ; end tabitem definition

GUISetState(@SW_SHOW, $MAIN_WINDOW)
While (1)
    $MSG = GUIGetMsg()
    Select
        Case $MSG = $EXIT
            Exit
        Case Else
        ;
    EndSelect
WEnd

Func _GUICtrlCreateEdgeBox($x,$y,$line_thickness,$width,$height,$color)
; left vertical line
    GUICtrlCreateEdge($x, $y, $line_thickness, $height, $color)
; top horizontal line
    GUICtrlCreateEdge($x, $y, $width, $line_thickness, $color)
; right vertical line
    GUICtrlCreateEdge($width + $x, $y, $line_thickness, $height, $color)
; bottom horizontal line
    GUICtrlCreateEdge($x, $height + $y, $width + $line_thickness, $line_thickness, $color)
EndFunc

Func GUICtrlCreateEdge($x, $y, $width, $height, $color)
    $edge= GUICtrlCreateLabel("", $x, $y, $width, $height, 0x1000)
    GUICtrlSetBkColor($edge, $color)
  Return $edge
EndFunc

Func _GUICtrlCreateEdgeButton($text,$x,$y,$line_thickness,$width,$height,$color)
    Local $edge_space=2
    Local $ctlid = GUICtrlCreateButton($text, $x, $y, $width, $height)
    _GUICtrlCreateEdgeBox($x - ($line_thickness + $edge_space), $y - ($line_thickness + $edge_space), _ 
                                $line_thickness, $width + ($line_thickness + ($edge_space*2)), _ 
                                $height + ($line_thickness + ($edge_space*2)), $color)
    Return $ctlid
EndFunc

Func _GUICreateEdgeInsideBorder($x,$y,$line_thickness,$width,$height,$color)
    _GUICtrlCreateEdgeBox($x+1,$y+1,$line_thickness,$width - ($line_thickness+1),$height - ($line_thickness+1),$color)
EndFunc

Func _GUICreateEdgeOutSideBorder($x,$y,$line_thickness,$width,$height,$color)
    Local $edge_space=$line_thickness
    _GUICtrlCreateEdgeBox($x-$edge_space,$y-$edge_space,$line_thickness,_ 
                                 $width + $line_thickness,_ 
                                 $height + $line_thickness,$color)
EndFunc

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Posted

that does look cool

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Posted (edited)

thanks, take a look at this.

Dim $W_HEIGHT = 500, $W_WIDTH = 500, $TITLE = "Another Edge Demo"

;==================================================================
; create the Main window
;==================================================================
;~ $MAIN_WINDOW = GUICreate($TITLE, $W_WIDTH, $W_HEIGHT)
$MAIN_WINDOW = _GUICreateEdged($TITLE,$W_WIDTH,$W_HEIGHT)

#Region --- CFCCodeWizard generated code Start ---
If Not IsDeclared('Silver') Then Global Const $Silver = 0xC0C0C0
GUISetBkColor($Silver)
#EndRegion --- CFCCodeWizard generated code End ---


If Not IsDeclared('Black') Then Global Const $Black = 0x000000
$Label_1 = _GUICreateEdgedCtrl("Label","A Label", 20, 20, 3, 120, 15,-1,-1,$Black)
$chkbox_1 = _GUICreateEdgedCtrl("checkbox","A check Box", 200, 20, 2)
$DATE_1 = _GUICreateEdgedCtrl("DATE","A DATE CONTROL", 350, 20, 3, 120)
$Input_1 = _GUICreateEdgedCtrl("Input","A Input Box", 20, 50, 2, 120)
$combo_1 = _GUICreateEdgedCtrl("COMBO","A Combo Box", 200, 50, 2, 120)
$EDIT_1 = _GUICreateEdgedCtrl("EDIT","A EDIT Box", 350, 50, 2, 120)
$LISTBOX_1 = _GUICreateEdgedCtrl("LISTBOX","A LIST Box", 20, 80, 2, 120)
$LISTVIEW_1 = _GUICreateEdgedCtrl("LISTVIEW","A LIST VIEW", 200, 80, 2, 120)
$RADIO_1 = _GUICreateEdgedCtrl("radio","A radio control", 350, 140, 3, 120)
;$test_1 = _GUICreateEdgedCtrl("test","testing", 350, 140, 3, 120)

$BUTTON_1 = _GUICreateEdgedCtrl("Button","A Button", 70, $W_HEIGHT - 40, 2, 120)
$EXIT = _GUICreateEdgedCtrl("Button","E&xit", 310, $W_HEIGHT - 40, 3, 120, 25,-1,-1,$Black)

;==================================================================
; create the tab control
;==================================================================
$TAB = GUICtrlCreateTab(10, 200, $W_WIDTH - 20, 200)

If Not IsDeclared('Blue') Then Global Const $Blue = 0x0000ff
_GUICreateEdgeOutSideBorder(10,200,3,$W_WIDTH - 20,200,$Blue)

;==================================================================
; create a tab
;==================================================================
$TABItem1 = GUICtrlCreateTabItem("test tab")
GUICtrlCreateTabitem (""); end tabitem definition
;==================================================================
; create a tab
;==================================================================
$TABItem2 = GUICtrlCreateTabItem("test tab 2")
GUICtrlCreateTabitem (""); end tabitem definition

;==================================================================
; create a tab
;==================================================================
$TABItem3 = GUICtrlCreateTabItem("test tab 3")
GUICtrlCreateTabitem (""); end tabitem definition

;==================================================================
; create a tab
;==================================================================
$TABItem4 = GUICtrlCreateTabItem("test tab 4")
GUICtrlCreateTabitem (""); end tabitem definition

;==================================================================
; create a tab
;==================================================================
$TABItem5 = GUICtrlCreateTabItem("test tab 5")
GUICtrlCreateTabitem (""); end tabitem definition

GUISetState(@SW_SHOW, $MAIN_WINDOW)

While (1)
    $MSG = GUIGetMsg()
    Select
        Case $MSG = $EXIT
            Exit
        Case Else
      ;
    EndSelect
WEnd

Func _GUICtrlCreateEdgeBox($x,$y,$line_thickness,$width,$height,$color)
; left vertical line
    GUICtrlCreateEdge($x, $y, $line_thickness, $height, $color)
; top horizontal line
    GUICtrlCreateEdge($x, $y, $width, $line_thickness, $color)
; right vertical line
    GUICtrlCreateEdge($width + $x, $y, $line_thickness, $height, $color)
; bottom horizontal line
    GUICtrlCreateEdge($x, $height + $y, $width + $line_thickness, $line_thickness, $color)
EndFunc

Func GUICtrlCreateEdge($x, $y, $width, $height, $color)
    GUICtrlSetBkColor(GUICtrlCreateLabel("", $x, $y, $width, $height, 0x1000), $color)
EndFunc

Func _GUICreateEdgedCtrl($control_type,$text,$x,$y,$line_thickness,$width=-1,$height=-1,$style=-1,$exstyle=-1,$color=-1)
    Local $edge_space=2
    If($width == -1) Then $width = 120
    Local $ctlid
    Select
        Case StringUpper($control_type) = "BUTTON"
            If($height == -1) Then $height = 20
            $ctlid = GUICtrlCreateButton($text, $x, $y, $width, $height,$style,$exstyle)
        Case StringUpper($control_type) = "LABEL"
            If($height == -1) Then $height = 20
            $ctlid = GUICtrlCreateLabel($text, $x, $y, $width, $height,$style,$exstyle)
        Case StringUpper($control_type) = "INPUT"
            If($height == -1) Then $height = 20
            $ctlid = GUICtrlCreateInput($text, $x, $y, $width, $height,$style,$exstyle)
        Case StringUpper($control_type) = "CHECKBOX"
            If($height == -1) Then $height = 20
            $ctlid = GUICtrlCreateCheckbox($text, $x, $y, $width, $height,$style,$exstyle)
        Case StringUpper($control_type) = "COMBO"
            If($height == -1) Then $height = 20
            $ctlid = GUICtrlCreateCombo($text, $x, $y, $width, $height,$style,$exstyle)
        Case StringUpper($control_type) = "DATE"
            If($height == -1) Then $height = 20
            $ctlid = GUICtrlCreateDate($text, $x, $y, $width, $height,$style,$exstyle)
        Case StringUpper($control_type) = "EDIT"
            If($height == -1) Then $height = 80
            $ctlid = GUICtrlCreateEdit($text, $x, $y, $width, $height,$style,$exstyle)
        Case StringUpper($control_type) = "LISTBOX"
            If($height == -1) Then $height = 80
            $ctlid = GUICtrlCreateList($text, $x, $y, $width, $height,$style,$exstyle)
        Case StringUpper($control_type) = "LISTVIEW"
            If($height == -1) Then $height = 80
            $ctlid = GUICtrlCreateListView($text, $x, $y, $width, $height,$style,$exstyle)
        Case StringUpper($control_type) = "RADIO"
            If($height == -1) Then $height = 20
            $ctlid = GUICtrlCreateRadio($text, $x, $y, $width, $height,$style,$exstyle)
        Case Else
            SetError(1)
            #Region --- CodeWizard generated code Start ---
        ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Warning
            MsgBox(48,"Error","Invalid Control Type: " & $control_type)
            #EndRegion --- CodeWizard generated code End ---
            Exit
    EndSelect
        If($color == -1) Then
            If Not IsDeclared('Black') Then Global Const $Black = 0x000000
            $color = $Black
        EndIf
    _GUICtrlCreateEdgeBox($x - ($line_thickness + $edge_space), $y - ($line_thickness + $edge_space), _ 
                                        $line_thickness, $width + ($line_thickness + ($edge_space*2)), _ 
                                        $height + ($line_thickness + ($edge_space*2)), $color)
    Return $ctlid
EndFunc

Func _GUICreateEdgeInsideBorder($x,$y,$line_thickness,$width,$height,$color)
    _GUICtrlCreateEdgeBox($x+2,$y+2,$line_thickness,_ 
                                    $width - ($line_thickness+1),_ 
                                    $height - ($line_thickness+1),$color)
EndFunc

Func _GUICreateEdgeOutSideBorder($x,$y,$line_thickness,$width,$height,$color)
    Local $edge_space=$line_thickness
    _GUICtrlCreateEdgeBox($x-$edge_space,$y-$edge_space,$line_thickness,_ 
                                        $width + $line_thickness,_ 
                                        $height + $line_thickness,$color)
EndFunc

Func _GUICreateEdged($title,$width=-1,$height=-1,$left=-1,$top=-1,$style=-1,$exstyle=-1,$parent=-1,$color=-1,$depth=2)
    If($color == -1) Then
        If Not IsDeclared('Black') Then Global Const $Black = 0x000000
        $color = $Black
    EndIf
    Local $guiID = GUICreate ($title,$width,$height,$left,$top,$style,$exstyle,$parent)
    _GUICreateEdgeInsideBorder($left,$top,$depth,$width,$height,$color)
    Return $guiID
EndFunc

Edit: The function name was redundant.

Edit2: added _GUICreateEdged, changed GUICtrlCreateEdge

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Posted

thats so awesome i never thought it would look that good in a real program

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Posted (edited)

You know, you don't have to specify $edge as a variable. instead of this:

$edge= GUICtrlCreateLabel("", $x, $y, $width, $height, 0x1000)
    GUICtrlSetBkColor($edge, $color)

use this:

GUICtrlSetBkColor(GUICtrlCreateLabel("", $x, $y, $width, $height, 0x1000), $color)

since you don't really need to store the control id to a variable! :)

also, check out my latest version of GUICtrlCreateLine here, which supports pixel size and color:

#70233

Edited by erifash
Posted (edited)

created a udf file for the edge stuff.

#include "edge_udf.au3"

Dim $W_HEIGHT = 500, $W_WIDTH = 500, $TITLE = "Another Edge Demo"

;==================================================================
; create the Main window
;==================================================================
;~ $MAIN_WINDOW = GUICreate($TITLE, $W_WIDTH, $W_HEIGHT)
;~ $MAIN_WINDOW = _GUICreateEdged($TITLE,$W_WIDTH,$W_HEIGHT,-1,-1,-1,-1,-1,-1,4)
$MAIN_WINDOW = _GUICreateEdged($TITLE,$W_WIDTH,$W_HEIGHT)

#Region --- CFCCodeWizard generated code Start ---
If Not IsDeclared('Silver') Then Global Const $Silver = 0xC0C0C0
GUISetBkColor($Silver)
#EndRegion --- CFCCodeWizard generated code End ---


If Not IsDeclared('Black') Then Global Const $Black = 0x000000
$Label_1 = _GUICreateEdgedCtrl("Label","A Label", 20, 20, 3, 120, 15,-1,-1,$Black)
$chkbox_1 = _GUICreateEdgedCtrl("checkbox","A check Box", 200, 20, 2)
$DATE_1 = _GUICreateEdgedCtrl("DATE","A DATE CONTROL", 350, 20, 3, 120)
$Input_1 = _GUICreateEdgedCtrl("Input","A Input Box", 20, 50, 2, 120)
$combo_1 = _GUICreateEdgedCtrl("COMBO","A Combo Box", 200, 50, 2, 120)
$EDIT_1 = _GUICreateEdgedCtrl("EDIT","A EDIT Box", 350, 50, 2, 120)
$LISTBOX_1 = _GUICreateEdgedCtrl("LISTBOX","A LIST Box", 20, 80, 2, 120)
$LISTVIEW_1 = _GUICreateEdgedCtrl("LISTVIEW","A LIST VIEW", 200, 80, 2, 120)
$RADIO_1 = _GUICreateEdgedCtrl("radio","A radio control", 350, 140, 3, 120)
;$test_1 = _GUICreateEdgedCtrl("test","testing", 350, 140, 3, 120)

$BUTTON_1 = _GUICreateEdgedCtrl("Button","A Button", 70, $W_HEIGHT - 40, 2, 120)
$EXIT = _GUICreateEdgedCtrl("Button","E&xit", 310, $W_HEIGHT - 40, 3, 120, 25,-1,-1,$Black)

;==================================================================
; create the tab control
;==================================================================
$TAB = GUICtrlCreateTab(10, 200, $W_WIDTH - 20, 200)

If Not IsDeclared('Blue') Then Global Const $Blue = 0x0000ff
_GUICreateEdgeOutSideBorder(10,200,3,$W_WIDTH - 20,200,$Blue)

;==================================================================
; create a tab
;==================================================================
$TABItem1 = GUICtrlCreateTabItem("test tab")
GUICtrlCreateTabitem (""); end tabitem definition
;==================================================================
; create a tab
;==================================================================
$TABItem2 = GUICtrlCreateTabItem("test tab 2")
GUICtrlCreateTabitem (""); end tabitem definition

;==================================================================
; create a tab
;==================================================================
$TABItem3 = GUICtrlCreateTabItem("test tab 3")
GUICtrlCreateTabitem (""); end tabitem definition

;==================================================================
; create a tab
;==================================================================
$TABItem4 = GUICtrlCreateTabItem("test tab 4")
GUICtrlCreateTabitem (""); end tabitem definition

;==================================================================
; create a tab
;==================================================================
$TABItem5 = GUICtrlCreateTabItem("test tab 5")
GUICtrlCreateTabitem (""); end tabitem definition

GUISetState(@SW_SHOW, $MAIN_WINDOW)

While (1)
    $MSG = GUIGetMsg()
    Select
        Case $MSG = $EXIT
            Exit
        Case Else
      ;
    EndSelect
WEnd
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Posted (edited)

correct erifash, changed it, also like your line draw, not sure if I would have any use for it, but never know.

<{POST_SNAPBACK}>

yup, exactly! :) Edited by erifash
Posted (edited)

not sure if these should be added

#include <GUIConstants.au3>
#include <edge_udf.au3>

Dim $W_HEIGHT = 300, $W_WIDTH = 500, $TITLE = "Another Edge Demo"
;==================================================================
; create the Main window
;==================================================================
$MAIN_WINDOW = _GUICreateEdged($TITLE,$W_WIDTH,$W_HEIGHT)

#Region --- CFCCodeWizard generated code Start ---
If Not IsDeclared('Silver') Then Global Const $Silver = 0xC0C0C0
GUISetBkColor($Silver)
#EndRegion --- CFCCodeWizard generated code End ---

$PIC = _GUICreateEdgedCtrlGraphic("pic",20,20,-1, 200,50,@Systemdir & "\oobe\images\mslogo.jpg")
$PROGRESS = _GUICreateEdgedCtrlGraphic("PROGRESS",20, 80)
$PROGRESS2 = _GUICreateEdgedCtrlGraphic("PROGRESS",160, 80, 3,-1,-1,"",-1,$PBS_SMOOTH)
$ani1 = _GUICreateEdgedCtrlGraphic("AVI",20,120,-1,-1,-1,@SystemDir & "\shell32.dll",150)
$icon = _GUICreateEdgedCtrlGraphic("icon",20,190,-1,-1,-1,"shell32.dll",10)
;$test_2 = _GUICreateEdgedCtrlGraphic("test","testing", 350, 140, 3, 120)

$EXIT = _GUICreateEdgedCtrl("Button","E&xit", 310, $W_HEIGHT - 40, -1, 120, 25)
GUISetState(@SW_SHOW, $MAIN_WINDOW)
GUICtrlSetState ($ani1, 1)
GUICtrlSetData ($PROGRESS,50)
GUICtrlSetData ($PROGRESS2,50)

Do
    $MSG = GUIGetMsg()
    Select
        Case $MSG = $EXIT
            ExitLoop
        Case Else
      ;
    EndSelect
Until $MSG = $GUI_EVENT_CLOSE

Edit: see above post

Edit2: Currently the _GUICreateEdged only works without menus, not sure how to fix it if menus are added to the gui.

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Posted

Minor change to see how it works with the current beta version using graphics instead of labels

Old code

Func GUICtrlCreateEdge($i_x, $i_y, $i_width, $i_height, $v_color)
    GUICtrlSetBkColor(GUICtrlCreateLabel("", $i_x, $i_y, $i_width, $i_height, 0x1000), $v_color)
EndFunc

new code

Func _GUICtrlCreateEdge($i_x, $i_y, $i_width, $i_height, $v_color)
    GuiCtrlCreateGraphic($i_X, $i_Y, $i_Width, $i_Height,0x1000)
    GUICtrlSetBkColor(-1,$v_color)
EndFunc

new zip file with change for using the new code below.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Posted

layer, any input? you got it started.

Sorry, i never saw that :) You've done such a good job, (Sorry, I'm not so good with words :D), just hope you keep it up! :( Besides that, I think everything looks fine, but you might want to post that into the UDF section of the "Scripts and Scraps" section :huh: And we'll see what they say! :D
FootbaG
  • 1 year later...
Posted

Here is my attempt to graph a function, using your GUICtrlCreateEdge. I am not much of a programmer, or a mathematician, but for what its worth...

Global $edge
Dim $x[400]
Dim $y[400]
For $n = 1 To 399 Step 1
   $x[$n] = Tan($n)
Next

Func GUICtrlCreateEdge($x, $y, $width, $height, $color)
   $edge = GUICtrlCreateLabel("", $x, $y, $width, $height, 0x1000)
   GUICtrlSetBkColor($edge, $color)
EndFunc  ;==>GUICtrlCreateEdge

GUICreate("Creating a Graph", 400, 400)
GUISetState()

For $n = 1 To 399 Step 1
   If $x[$n] > 8 Then
      GUICtrlCreateEdge($n, $x[$n], 5, 5, 0xFF0000)
   EndIf
Next

While 1
   $get = GUIGetMsg()
   If $get = -3 Then Exit
WEnd
"I've seen your work in the past, and it's novice at best..." SmOke_N

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
×
×
  • Create New...