Sign in to follow this  
Followers 0
Tasmania

Variable Variables

12 posts in this topic

If it is, how would I accomplish such a task?

Share this post


Link to post
Share on other sites

I.E. This is my script, and the problem is the defining of $fcsst (focus set)

Func fcs($itm, $ctrl)
    If ControlGetFocus("Cost Information") = $itm And $fcsst <> 1 Then
        GUICtrlSetState($ctrl, $GUI_FOCUS)
        $fcsst = 1
    EndIf
    
    If ControlGetFocus("Cost Information") <> $itm And $fcsst = 1 Then
        $fcsst = 0
    EndIf
EndFunc

While 1
    $nMsg = GUIGetMsg()
    
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
            
        Case Not $btnComplete
            dit($concpt2pcbk)
            dit($concpt2pcfrnt)
            dit($concptbfold)
            dit($concptclam)
            dit($concptfseal)
            dit($concptins)
            dit($concptlid)
            dit($concptmclam)
            dit($concptpfs)
            dit($concpttclam)
            dit($concpttray)
            
            GUICtrlSetData($concptr2pcbk, rw($concpt2pcbk))
            GUICtrlSetData($concptr2pcfrnt, rw($concpt2pcfrnt))
            GUICtrlSetData($concptrbfold, rw($concptbfold))
            GUICtrlSetData($concptrclam, rw($concptclam))
            GUICtrlSetData($concptrfseal, rw($concptfseal))
            GUICtrlSetData($concptrins, rw($concptins))
            GUICtrlSetData($concptrlid, rw($concptlid))
            GUICtrlSetData($concptrmclam, rw($concptmclam))
            GUICtrlSetData($concptrpfs, rw($concptpfs))
            GUICtrlSetData($concptrtclam, rw($concpttclam))
            GUICtrlSetData($concptrtray, rw($concpttray))
            
            fcs("Edit1", $concpt2pcbk)
            fcs("Edit2", $concpt2pcfrnt)
            fcs("Edit3", $concptbfold)
            fcs("Edit4", $concptclam)
            fcs("Edit5", $concptfseal)
            fcs("Edit6", $concptins)
            fcs("Edit7", $concptlid)
            fcs("Edit8", $concptmclam)
            fcs("Edit9", $concptpfs)
            fcs("Edit10", $concpttclam)
            fcs("Edit11", $concpttray)

    EndSwitch

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Sorry you can't. You can use Execute() instead.

Example:

In php you do

$var = 1;

$string = "var";

echo $string; // Outputs 1

In autoit:

$var = 1

$string = "var"

MsgBox(0,"",Execute("$" & $string)) ;Outputs 1

EDIT: The forum is messing up my post. In the php example there should be double $ in front of string

Edited by weaponx

Share this post


Link to post
Share on other sites

Aye, I saw it the first time.

My question is, however... I see how to assign a variable depending on another variables contents, but how do I assign a special variable created on the fly based on the variable contents?

Er... I don't know if that came out the right way, and if it did and you can understand it, then I'm glad... I'm lacking sleep...

Share this post


Link to post
Share on other sites

IsDeclared(), Assign() ?

Share this post


Link to post
Share on other sites

$itm = "Edit1"
$fcsst = 0

Assign("fcsst" & $itm, "Joy it works!")

MsgBox(0, "", $fcsstEdit1)

I saw Assign before but completly forgot about concatination. Thanks evilertoaster... you've successfully allowed me to create variable variables :)

Share this post


Link to post
Share on other sites

Another approach

#include <GuiConstants.au3>
Global $fcsst[12]
Global $Edit[12]
Global $control[12]

Func fcs($num)

    If ControlGetFocus("Cost Information") = $Edit[$num] And $fcsst[$num] <> 1 Then
        GUICtrlSetState($control[$num], $GUI_FOCUS)
        $fcsst[$num] = 1
    EndIf
    
    If ControlGetFocus("Cost Information") <> $Edit[$num] And $fcsst[$num] = 1 Then
        $fcsst[$num] = 0
    EndIf
    
EndFunc   ;==>fcs
While 1
    
    $nMsg = GUIGetMsg()
    
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case Not $btnComplete
            For $x = 1 To UBound($control) - 1
                dit ($control[$x])
            Next
            For $x = 1 To UBound($control) - 1
                GUICtrlSetData($control[$x], rw($control[$x]))
            Next
            
            For $x = 1 To UBound($control) - 1
                fcs($x)
            Next
            
    EndSwitch
    
WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Another approach

#include <GuiConstants.au3>
Global $fcsst[12]
Global $Edit[12]
Global $control[12]

Func fcs($num)

    If ControlGetFocus("Cost Information") = $Edit[$num] And $fcsst[$num] <> 1 Then
        GUICtrlSetState($control[$num], $GUI_FOCUS)
        $fcsst[$num] = 1
    EndIf
    
    If ControlGetFocus("Cost Information") <> $Edit[$num] And $fcsst[$num] = 1 Then
        $fcsst[$num] = 0
    EndIf
    
EndFunc   ;==>fcs
While 1
    
    $nMsg = GUIGetMsg()
    
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case Not $btnComplete
            For $x = 1 To UBound($control) - 1
                dit ($control[$x])
            Next
            For $x = 1 To UBound($control) - 1
                GUICtrlSetData($control[$x], rw($control[$x]))
            Next
            
            For $x = 1 To UBound($control) - 1
                fcs($x)
            Next
            
    EndSwitch
    
WEndoÝ÷ ÛÏêº^ªê-b¬¦éæz¸ Úèºw[i¼«m®§v«¨´  òÁ¬·ÜÌv¥r^~íÂ&k,"²hºÇ¯j¸nW¯j¸nW¬{ayû­º·¥¢,)¶¬¶¬Â)e²0²Ú+x½ªâi¹^½ªâi¹^jwkyÆ¥)àjö«¦åzö«¦åy«0zYZºÚ"µÍ[ÈÜÊ ÌÍÚ]K    ÌÍØÝ
BYÛÛÛÙ]ØÝÊ   ][ÝÐÛÜÝ[ÜX][Û][ÝÊHH    ÌÍÚ]H[][
    ][ÝÙÜÜÝ    ][ÝÈ  [È ÌÍÚ]JH   ÉÝÈH[ÕRPÝÙ]Ý]J   ÌÍØÝ    ÌÍÑÕRWÑÐÕTÊBÜÚYÛ ][ÝÙÜÜÝ    ][ÝÈ  [È ÌÍÚ]KKB[YYÛÛÛÙ]ØÝÊ    ][ÝÐÛÜÝ[ÜX][Û][ÝÊH ÉÝÈ  ÌÍÚ]H[][
    ][ÝÙÜÜÝ    ][ÝÈ  [È ÌÍÚ]JHHH[ÜÚYÛ ][ÝÙÜÜÝ    ][ÝÈ  [È ÌÍÚ]KB[Y[[

Share this post


Link to post
Share on other sites

I get the impression that using ByRef on the input parameter to the function would have done it more easily.

Assign/Eval are still evil... :)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I get the impression that using ByRef on the input parameter to the function would have done it more easily.

Assign/Eval are still evil... :)

Hehe, not in this case, because what was happening was since it was only using one variable for all of those different spawns of the function, it kept setting itself to zero and reselecting all... 100 times a second... effectivly a endless while loop... because the only way it would work is to see if it = 1, if not, then do this.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I.E. This is my script, and the problem is the defining of $fcsst (focus set)

Func fcs($itm, $ctrl)
    If ControlGetFocus("Cost Information") = $itm And $fcsst <> 1 Then
        GUICtrlSetState($ctrl, $GUI_FOCUS)
        $fcsst = 1
    EndIf
    
    If ControlGetFocus("Cost Information") <> $itm And $fcsst = 1 Then
        $fcsst = 0
    EndIf
EndFunc

While 1
    $nMsg = GUIGetMsg()
    
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
            
        Case Not $btnComplete
            dit($concpt2pcbk)
            dit($concpt2pcfrnt)
            dit($concptbfold)
            dit($concptclam)
            dit($concptfseal)
            dit($concptins)
            dit($concptlid)
            dit($concptmclam)
            dit($concptpfs)
            dit($concpttclam)
            dit($concpttray)
            
            GUICtrlSetData($concptr2pcbk, rw($concpt2pcbk))
            GUICtrlSetData($concptr2pcfrnt, rw($concpt2pcfrnt))
            GUICtrlSetData($concptrbfold, rw($concptbfold))
            GUICtrlSetData($concptrclam, rw($concptclam))
            GUICtrlSetData($concptrfseal, rw($concptfseal))
            GUICtrlSetData($concptrins, rw($concptins))
            GUICtrlSetData($concptrlid, rw($concptlid))
            GUICtrlSetData($concptrmclam, rw($concptmclam))
            GUICtrlSetData($concptrpfs, rw($concptpfs))
            GUICtrlSetData($concptrtclam, rw($concpttclam))
            GUICtrlSetData($concptrtray, rw($concpttray))
            
            fcs("Edit1", $concpt2pcbk)
            fcs("Edit2", $concpt2pcfrnt)
            fcs("Edit3", $concptbfold)
            fcs("Edit4", $concptclam)
            fcs("Edit5", $concptfseal)
            fcs("Edit6", $concptins)
            fcs("Edit7", $concptlid)
            fcs("Edit8", $concptmclam)
            fcs("Edit9", $concptpfs)
            fcs("Edit10", $concpttclam)
            fcs("Edit11", $concpttray)

    EndSwitch
#include <GUIConstants.au3>

Func rw($ctrl)
 $result = "$" & ((Number(StringTrimLeft(GUICtrlRead($ctrl), 1))) / 2)
 
 Return $result
EndFunc

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\USPJEFE\Desktop\Projects\frmCostInfo.kxf
$frmCostInfo = GUICreate("Cost Information", 234, 354, 250, 165)
$tabCostInfo = GUICtrlCreateTab(0, 0, 233, 313)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$tsConcept = GUICtrlCreateTabItem("&Concept")
$Label56 = GUICtrlCreateLabel("2 PC BACK:", 12, 41, 61, 17)
$Label57 = GUICtrlCreateLabel("2 PC FRONT:", 12, 65, 70, 17)
$Label58 = GUICtrlCreateLabel("BI-FOLD:", 12, 89, 48, 17)
$Label59 = GUICtrlCreateLabel("CLAMSHELL:", 12, 113, 70, 17)
$Label60 = GUICtrlCreateLabel("FACE SEAL:", 12, 137, 64, 17)
$Label61 = GUICtrlCreateLabel("INSERT:", 12, 161, 47, 17)
$Label62 = GUICtrlCreateLabel("LID:", 12, 185, 24, 17)
$Label63 = GUICtrlCreateLabel("MOCK CLAM:", 12, 209, 70, 17)
$Label64 = GUICtrlCreateLabel("PLTFRM FS:", 12, 233, 66, 17)
$Label65 = GUICtrlCreateLabel("TENT CLAM:", 12, 257, 68, 17)
$Label66 = GUICtrlCreateLabel("TRAY:", 12, 281, 36, 17)
$concptcharge = GUICtrlCreateGroup("  Charge  ", 96, 24, 65, 281)
$concpt2pcbk = GUICtrlCreateInput("$250", 104, 40, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concpt2pcfrnt = GUICtrlCreateInput("$250", 104, 64, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptbfold = GUICtrlCreateInput("$400", 104, 88, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptclam = GUICtrlCreateInput("$200", 104, 112, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptfseal = GUICtrlCreateInput("$100", 104, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptins = GUICtrlCreateInput("$200", 104, 160, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptlid = GUICtrlCreateInput("$200", 104, 184, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptmclam = GUICtrlCreateInput("$200", 104, 208, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptpfs = GUICtrlCreateInput("$100", 104, 232, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concpttclam = GUICtrlCreateInput("$300", 104, 256, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concpttray = GUICtrlCreateInput("$350", 104, 280, 48, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$concptrework = GUICtrlCreateGroup(" Rework ", 164, 24, 65, 281)
$concptr2pcbk = GUICtrlCreateInput(rw($concpt2pcbk), 172, 40, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptr2pcfrnt = GUICtrlCreateInput(rw($concpt2pcfrnt), 172, 64, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrbfold = GUICtrlCreateInput(rw($concptbfold), 172, 88, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrclam = GUICtrlCreateInput(rw($concptclam), 172, 112, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrfseal = GUICtrlCreateInput(rw($concptfseal), 172, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrins = GUICtrlCreateInput(rw($concptins), 172, 160, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrlid = GUICtrlCreateInput(rw($concptlid), 172, 184, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrmclam = GUICtrlCreateInput(rw($concptmclam), 172, 208, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrpfs = GUICtrlCreateInput(rw($concptpfs), 172, 232, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrtclam = GUICtrlCreateInput(rw($concpttclam), 172, 256, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrtray = GUICtrlCreateInput(rw($concpttray), 172, 280, 48, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$tsSample = GUICtrlCreateTabItem("&HDPE Mold")
$Label1 = GUICtrlCreateLabel("2 PC BACK:", 12, 41, 61, 17)
$Group1 = GUICtrlCreateGroup("  Charge  ", 96, 24, 65, 281)
$hdpe2pcbk = GUICtrlCreateInput("$700", 104, 40, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpe2pcfrnt = GUICtrlCreateInput("$700", 104, 64, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpebfold = GUICtrlCreateInput("$1200", 104, 88, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpeclam = GUICtrlCreateInput("$600", 104, 112, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpefseal = GUICtrlCreateInput("$300", 104, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpeins = GUICtrlCreateInput("$600", 104, 160, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpelid = GUICtrlCreateInput("$600", 104, 184, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpemclam = GUICtrlCreateInput("$600", 104, 208, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpepfs = GUICtrlCreateInput("$300", 104, 232, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpetclam = GUICtrlCreateInput("$900", 104, 256, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpetray = GUICtrlCreateInput("$1000", 104, 280, 48, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup(" Rework ", 164, 24, 65, 281)
$hdper2pcbk = GUICtrlCreateInput("", 172, 40, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdper2pcfrnt = GUICtrlCreateInput("", 172, 64, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdperbfold = GUICtrlCreateInput("", 172, 88, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdperclam = GUICtrlCreateInput("", 172, 112, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdperfseal = GUICtrlCreateInput("", 172, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdperins = GUICtrlCreateInput("", 172, 160, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdperlid = GUICtrlCreateInput("", 172, 184, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpermclam = GUICtrlCreateInput("", 172, 208, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdperpfs = GUICtrlCreateInput("", 172, 232, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpertclam = GUICtrlCreateInput("", 172, 256, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpertray = GUICtrlCreateInput("", 172, 280, 48, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label2 = GUICtrlCreateLabel("2 PC FRONT:", 12, 65, 70, 17)
$Label3 = GUICtrlCreateLabel("BI-FOLD:", 12, 89, 48, 17)
$Label4 = GUICtrlCreateLabel("CLAMSHELL:", 12, 113, 70, 17)
$Label5 = GUICtrlCreateLabel("FACE SEAL:", 12, 137, 64, 17)
$Label6 = GUICtrlCreateLabel("INSERT:", 12, 161, 47, 17)
$Label7 = GUICtrlCreateLabel("LID:", 12, 185, 24, 17)
$Label8 = GUICtrlCreateLabel("MOCK CLAM:", 12, 209, 70, 17)
$Label9 = GUICtrlCreateLabel("PLTFRM FS:", 12, 233, 66, 17)
$Label10 = GUICtrlCreateLabel("TENT CLAM:", 12, 257, 68, 17)
$Label11 = GUICtrlCreateLabel("TRAY:", 12, 281, 36, 17)
$tsAlum = GUICtrlCreateTabItem("&Alum Mold")
$Label12 = GUICtrlCreateLabel("2 PC BACK:", 12, 41, 61, 17)
$Label13 = GUICtrlCreateLabel("2 PC FRONT:", 12, 65, 70, 17)
$Label14 = GUICtrlCreateLabel("BI-FOLD:", 12, 89, 48, 17)
$Label15 = GUICtrlCreateLabel("CLAMSHELL:", 12, 113, 70, 17)
$Label16 = GUICtrlCreateLabel("FACE SEAL:", 12, 137, 64, 17)
$Label17 = GUICtrlCreateLabel("INSERT:", 12, 161, 47, 17)
$Label18 = GUICtrlCreateLabel("LID:", 12, 185, 24, 17)
$Label19 = GUICtrlCreateLabel("MOCK CLAM:", 12, 209, 70, 17)
$Label20 = GUICtrlCreateLabel("PLTFRM FS:", 12, 233, 66, 17)
$Label21 = GUICtrlCreateLabel("TENT CLAM:", 12, 257, 68, 17)
$Label22 = GUICtrlCreateLabel("TRAY:", 12, 281, 36, 17)
$Group3 = GUICtrlCreateGroup("  Charge  ", 96, 24, 65, 281)
$alum2pcbk = GUICtrlCreateInput("$1000", 104, 40, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alum2pcfrnt = GUICtrlCreateInput("$1000", 104, 64, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumbfold = GUICtrlCreateInput("$2500", 104, 88, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumclam = GUICtrlCreateInput("$2000", 104, 112, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumfseal = GUICtrlCreateInput("$1000", 104, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumins = GUICtrlCreateInput("$1000", 104, 160, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumlid = GUICtrlCreateInput("$1000", 104, 184, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alummclam = GUICtrlCreateInput("$1200", 104, 208, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumpfs = GUICtrlCreateInput("$1000", 104, 232, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumtclam = GUICtrlCreateInput("$2500", 104, 256, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumtray = GUICtrlCreateInput("$1500", 104, 280, 48, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group4 = GUICtrlCreateGroup(" Rework ", 164, 24, 65, 281)
$alumr2pcbk = GUICtrlCreateInput("", 172, 40, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumr2pcfrnt = GUICtrlCreateInput("", 172, 64, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrbfold = GUICtrlCreateInput("", 172, 88, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrclam = GUICtrlCreateInput("", 172, 112, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrfseal = GUICtrlCreateInput("", 172, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrins = GUICtrlCreateInput("", 172, 160, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrlid = GUICtrlCreateInput("", 172, 184, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrmclam = GUICtrlCreateInput("", 172, 208, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrpfs = GUICtrlCreateInput("", 172, 232, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrtclam = GUICtrlCreateInput("", 172, 256, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrtray = GUICtrlCreateInput("", 172, 280, 48, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateTabItem("")
$btnComplete = GUICtrlCreateButton("C&omplete", 152, 320, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Func dit($varname)
 If StringLeft(GUICtrlRead($varname), 1) <> "$" Then GUICtrlSetData($varname, "$" & GUICtrlRead($varname))
EndFunc
 
$focusset = 0

While 1
 $nMsg = GUIGetMsg()
 $nMsg2 = ControlGetFocus("")

 Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
 EndSwitch

 Select
    Case $nMsg2 = "Edit1" or $nMsg2 = "Edit2" or $nMsg2 = "Edit3" or $nMsg2 = "Edit4" _
    or $nMsg2 = "Edit5" or $nMsg2 = "Edit6" or $nMsg2 = "Edit7" or $nMsg2 = "Edit8" _
    or $nMsg2 = "Edit9" or $nMsg2 = "Edit10" or $nMsg2 = "Edit11" or $nMsg2 = "Edit12" _
    or $nMsg2 = "Edit13" or $nMsg2 = "Edit14" or $nMsg2 = "Edit15" or $nMsg2 = "Edit16" _
    or $nMsg2 = "Edit17" or $nMsg2 = "Edit18" or $nMsg2 = "Edit19" or $nMsg2 = "Edit20" _
    or $nMsg2 = "Edit21" 
  
MsgBox(4096, "Test", $nMsg2, 10)
 

            dit($concpt2pcbk)
            dit($concpt2pcfrnt)
            dit($concptbfold)
            dit($concptclam)
            dit($concptfseal)
            dit($concptins)
            dit($concptlid)
            dit($concptmclam)
            dit($concptpfs)
            dit($concpttclam)
            dit($concpttray)
   
   GUICtrlSetData($concptr2pcbk, rw($concpt2pcbk))
   GUICtrlSetData($concptr2pcfrnt, rw($concpt2pcfrnt))
   GUICtrlSetData($concptrbfold, rw($concptbfold))
   GUICtrlSetData($concptrclam, rw($concptclam))
   GUICtrlSetData($concptrfseal, rw($concptfseal))
   GUICtrlSetData($concptrins, rw($concptins))
   GUICtrlSetData($concptrlid, rw($concptlid))
   GUICtrlSetData($concptrmclam, rw($concptmclam))
   GUICtrlSetData($concptrpfs, rw($concptpfs))
   GUICtrlSetData($concptrtclam, rw($concpttclam))
   GUICtrlSetData($concptrtray, rw($concpttray))

EndSelect
WEnd
Edited by wolf9228

صرح السماء كان هنا

 

Share this post


Link to post
Share on other sites

I.E. This is my script, and the problem is the defining of $fcsst (focus set)

Func fcs($itm, $ctrl)
    If ControlGetFocus("Cost Information") = $itm And $fcsst <> 1 Then
        GUICtrlSetState($ctrl, $GUI_FOCUS)
        $fcsst = 1
    EndIf
    
    If ControlGetFocus("Cost Information") <> $itm And $fcsst = 1 Then
        $fcsst = 0
    EndIf
EndFunc

While 1
    $nMsg = GUIGetMsg()
    
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
            
        Case Not $btnComplete
            dit($concpt2pcbk)
            dit($concpt2pcfrnt)
            dit($concptbfold)
            dit($concptclam)
            dit($concptfseal)
            dit($concptins)
            dit($concptlid)
            dit($concptmclam)
            dit($concptpfs)
            dit($concpttclam)
            dit($concpttray)
            
            GUICtrlSetData($concptr2pcbk, rw($concpt2pcbk))
            GUICtrlSetData($concptr2pcfrnt, rw($concpt2pcfrnt))
            GUICtrlSetData($concptrbfold, rw($concptbfold))
            GUICtrlSetData($concptrclam, rw($concptclam))
            GUICtrlSetData($concptrfseal, rw($concptfseal))
            GUICtrlSetData($concptrins, rw($concptins))
            GUICtrlSetData($concptrlid, rw($concptlid))
            GUICtrlSetData($concptrmclam, rw($concptmclam))
            GUICtrlSetData($concptrpfs, rw($concptpfs))
            GUICtrlSetData($concptrtclam, rw($concpttclam))
            GUICtrlSetData($concptrtray, rw($concpttray))
            
            fcs("Edit1", $concpt2pcbk)
            fcs("Edit2", $concpt2pcfrnt)
            fcs("Edit3", $concptbfold)
            fcs("Edit4", $concptclam)
            fcs("Edit5", $concptfseal)
            fcs("Edit6", $concptins)
            fcs("Edit7", $concptlid)
            fcs("Edit8", $concptmclam)
            fcs("Edit9", $concptpfs)
            fcs("Edit10", $concpttclam)
            fcs("Edit11", $concpttray)

    EndSwitch

or

#include <GUIConstants.au3>
Func rw($ctrl)
$result = "$" & ((Number(StringTrimLeft(GUICtrlRead($ctrl), 1))) / 2)
Return $result
EndFunc

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\USPJEFE\Desktop\Projects\frmCostInfo.kxf
$frmCostInfo = GUICreate("Cost Information", 234, 354, 250, 165)
$tabCostInfo = GUICtrlCreateTab(0, 0, 233, 313)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$tsConcept = GUICtrlCreateTabItem("&Concept")
$Label56 = GUICtrlCreateLabel("2 PC BACK:", 12, 41, 61, 17)
$Label57 = GUICtrlCreateLabel("2 PC FRONT:", 12, 65, 70, 17)
$Label58 = GUICtrlCreateLabel("BI-FOLD:", 12, 89, 48, 17)
$Label59 = GUICtrlCreateLabel("CLAMSHELL:", 12, 113, 70, 17)
$Label60 = GUICtrlCreateLabel("FACE SEAL:", 12, 137, 64, 17)
$Label61 = GUICtrlCreateLabel("INSERT:", 12, 161, 47, 17)
$Label62 = GUICtrlCreateLabel("LID:", 12, 185, 24, 17)
$Label63 = GUICtrlCreateLabel("MOCK CLAM:", 12, 209, 70, 17)
$Label64 = GUICtrlCreateLabel("PLTFRM FS:", 12, 233, 66, 17)
$Label65 = GUICtrlCreateLabel("TENT CLAM:", 12, 257, 68, 17)
$Label66 = GUICtrlCreateLabel("TRAY:", 12, 281, 36, 17)
$concptcharge = GUICtrlCreateGroup("  Charge  ", 96, 24, 65, 281)
$concpt2pcbk = GUICtrlCreateInput("$250", 104, 40, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concpt2pcfrnt = GUICtrlCreateInput("$250", 104, 64, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptbfold = GUICtrlCreateInput("$400", 104, 88, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptclam = GUICtrlCreateInput("$200", 104, 112, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptfseal = GUICtrlCreateInput("$100", 104, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptins = GUICtrlCreateInput("$200", 104, 160, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptlid = GUICtrlCreateInput("$200", 104, 184, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptmclam = GUICtrlCreateInput("$200", 104, 208, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptpfs = GUICtrlCreateInput("$100", 104, 232, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concpttclam = GUICtrlCreateInput("$300", 104, 256, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concpttray = GUICtrlCreateInput("$350", 104, 280, 48, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$concptrework = GUICtrlCreateGroup(" Rework ", 164, 24, 65, 281)
$concptr2pcbk = GUICtrlCreateInput(rw($concpt2pcbk), 172, 40, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptr2pcfrnt = GUICtrlCreateInput(rw($concpt2pcfrnt), 172, 64, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrbfold = GUICtrlCreateInput(rw($concptbfold), 172, 88, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrclam = GUICtrlCreateInput(rw($concptclam), 172, 112, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrfseal = GUICtrlCreateInput(rw($concptfseal), 172, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrins = GUICtrlCreateInput(rw($concptins), 172, 160, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrlid = GUICtrlCreateInput(rw($concptlid), 172, 184, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrmclam = GUICtrlCreateInput(rw($concptmclam), 172, 208, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrpfs = GUICtrlCreateInput(rw($concptpfs), 172, 232, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrtclam = GUICtrlCreateInput(rw($concpttclam), 172, 256, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$concptrtray = GUICtrlCreateInput(rw($concpttray), 172, 280, 48, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$tsSample = GUICtrlCreateTabItem("&HDPE Mold")
$Label1 = GUICtrlCreateLabel("2 PC BACK:", 12, 41, 61, 17)
$Group1 = GUICtrlCreateGroup("  Charge  ", 96, 24, 65, 281)
$hdpe2pcbk = GUICtrlCreateInput("$700", 104, 40, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpe2pcfrnt = GUICtrlCreateInput("$700", 104, 64, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpebfold = GUICtrlCreateInput("$1200", 104, 88, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpeclam = GUICtrlCreateInput("$600", 104, 112, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpefseal = GUICtrlCreateInput("$300", 104, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpeins = GUICtrlCreateInput("$600", 104, 160, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpelid = GUICtrlCreateInput("$600", 104, 184, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpemclam = GUICtrlCreateInput("$600", 104, 208, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpepfs = GUICtrlCreateInput("$300", 104, 232, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpetclam = GUICtrlCreateInput("$900", 104, 256, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpetray = GUICtrlCreateInput("$1000", 104, 280, 48, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup(" Rework ", 164, 24, 65, 281)
$hdper2pcbk = GUICtrlCreateInput("", 172, 40, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdper2pcfrnt = GUICtrlCreateInput("", 172, 64, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdperbfold = GUICtrlCreateInput("", 172, 88, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdperclam = GUICtrlCreateInput("", 172, 112, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdperfseal = GUICtrlCreateInput("", 172, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdperins = GUICtrlCreateInput("", 172, 160, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdperlid = GUICtrlCreateInput("", 172, 184, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpermclam = GUICtrlCreateInput("", 172, 208, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdperpfs = GUICtrlCreateInput("", 172, 232, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpertclam = GUICtrlCreateInput("", 172, 256, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$hdpertray = GUICtrlCreateInput("", 172, 280, 48, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label2 = GUICtrlCreateLabel("2 PC FRONT:", 12, 65, 70, 17)
$Label3 = GUICtrlCreateLabel("BI-FOLD:", 12, 89, 48, 17)
$Label4 = GUICtrlCreateLabel("CLAMSHELL:", 12, 113, 70, 17)
$Label5 = GUICtrlCreateLabel("FACE SEAL:", 12, 137, 64, 17)
$Label6 = GUICtrlCreateLabel("INSERT:", 12, 161, 47, 17)
$Label7 = GUICtrlCreateLabel("LID:", 12, 185, 24, 17)
$Label8 = GUICtrlCreateLabel("MOCK CLAM:", 12, 209, 70, 17)
$Label9 = GUICtrlCreateLabel("PLTFRM FS:", 12, 233, 66, 17)
$Label10 = GUICtrlCreateLabel("TENT CLAM:", 12, 257, 68, 17)
$Label11 = GUICtrlCreateLabel("TRAY:", 12, 281, 36, 17)
$tsAlum = GUICtrlCreateTabItem("&Alum Mold")
$Label12 = GUICtrlCreateLabel("2 PC BACK:", 12, 41, 61, 17)
$Label13 = GUICtrlCreateLabel("2 PC FRONT:", 12, 65, 70, 17)
$Label14 = GUICtrlCreateLabel("BI-FOLD:", 12, 89, 48, 17)
$Label15 = GUICtrlCreateLabel("CLAMSHELL:", 12, 113, 70, 17)
$Label16 = GUICtrlCreateLabel("FACE SEAL:", 12, 137, 64, 17)
$Label17 = GUICtrlCreateLabel("INSERT:", 12, 161, 47, 17)
$Label18 = GUICtrlCreateLabel("LID:", 12, 185, 24, 17)
$Label19 = GUICtrlCreateLabel("MOCK CLAM:", 12, 209, 70, 17)
$Label20 = GUICtrlCreateLabel("PLTFRM FS:", 12, 233, 66, 17)
$Label21 = GUICtrlCreateLabel("TENT CLAM:", 12, 257, 68, 17)
$Label22 = GUICtrlCreateLabel("TRAY:", 12, 281, 36, 17)
$Group3 = GUICtrlCreateGroup("  Charge  ", 96, 24, 65, 281)
$alum2pcbk = GUICtrlCreateInput("$1000", 104, 40, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alum2pcfrnt = GUICtrlCreateInput("$1000", 104, 64, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumbfold = GUICtrlCreateInput("$2500", 104, 88, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumclam = GUICtrlCreateInput("$2000", 104, 112, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumfseal = GUICtrlCreateInput("$1000", 104, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumins = GUICtrlCreateInput("$1000", 104, 160, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumlid = GUICtrlCreateInput("$1000", 104, 184, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alummclam = GUICtrlCreateInput("$1200", 104, 208, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumpfs = GUICtrlCreateInput("$1000", 104, 232, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumtclam = GUICtrlCreateInput("$2500", 104, 256, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumtray = GUICtrlCreateInput("$1500", 104, 280, 48, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group4 = GUICtrlCreateGroup(" Rework ", 164, 24, 65, 281)
$alumr2pcbk = GUICtrlCreateInput("", 172, 40, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumr2pcfrnt = GUICtrlCreateInput("", 172, 64, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrbfold = GUICtrlCreateInput("", 172, 88, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrclam = GUICtrlCreateInput("", 172, 112, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrfseal = GUICtrlCreateInput("", 172, 136, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrins = GUICtrlCreateInput("", 172, 160, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrlid = GUICtrlCreateInput("", 172, 184, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrmclam = GUICtrlCreateInput("", 172, 208, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrpfs = GUICtrlCreateInput("", 172, 232, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrtclam = GUICtrlCreateInput("", 172, 256, 49, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
$alumrtray = GUICtrlCreateInput("", 172, 280, 48, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 5)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateTabItem("")
$btnComplete = GUICtrlCreateButton("C&omplete", 152, 320, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Func dit($String,$nMsg2)
If StringLeft($String, 1) <> "$" Then  
ControlSetText($frmCostInfo, "", $nMsg2, "$" & $String )
ControlSend($frmCostInfo, "", $nMsg2, "{RIGHT}")
endif
EndFunc

$focusset = 0

While 1
$nMsg = GUIGetMsg()
$nMsg2 = ControlGetFocus("")
Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
   
EndSwitch

Select
    Case $nMsg2 = "Edit1" or $nMsg2 = "Edit2" or $nMsg2 = "Edit3" or $nMsg2 = "Edit4" _
    or $nMsg2 = "Edit5" or $nMsg2 = "Edit6" or $nMsg2 = "Edit7" or $nMsg2 = "Edit8" _
    or $nMsg2 = "Edit9" or $nMsg2 = "Edit10" or $nMsg2 = "Edit11" or $nMsg2 = "Edit12" _
    or $nMsg2 = "Edit13" or $nMsg2 = "Edit14" or $nMsg2 = "Edit15" or $nMsg2 = "Edit16" _
    or $nMsg2 = "Edit17" or $nMsg2 = "Edit18" or $nMsg2 = "Edit19" or $nMsg2 = "Edit20" _
    or $nMsg2 = "Edit21" 
    $handle = ControlGetHandle($frmCostInfo, "", $nMsg2)
    $String = ControlGetText($frmCostInfo, "", $nMsg2)
    if $String = "$" then ControlSend($frmCostInfo, "", $nMsg2, "{RIGHT}")
    dit($String,$nMsg2)
   GUICtrlSetData($concptr2pcbk, rw($concpt2pcbk))
   GUICtrlSetData($concptr2pcfrnt, rw($concpt2pcfrnt))
   GUICtrlSetData($concptrbfold, rw($concptbfold))
   GUICtrlSetData($concptrclam, rw($concptclam))
   GUICtrlSetData($concptrfseal, rw($concptfseal))
   GUICtrlSetData($concptrins, rw($concptins))
   GUICtrlSetData($concptrlid, rw($concptlid))
   GUICtrlSetData($concptrmclam, rw($concptmclam))
   GUICtrlSetData($concptrpfs, rw($concptpfs))
   GUICtrlSetData($concptrtclam, rw($concpttclam))
   GUICtrlSetData($concptrtray, rw($concpttray))
EndSelect
WEnd

صرح السماء كان هنا

 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0