; FieldPlus #include-once #include #include OnAutoItExitRegister("_FieldPlus_OnExit") If Not IsDeclared("SD") Then Global $SD = "Scripting.Dictionary" Global $_oFieldPlus = ObjCreate($SD) Global $_sFieldPlus_LabelFont Global $_sFieldPlus_LabelFontSize Global $_sFieldPlus_InputFontSize Global $_hFieldPlus_ToolTip1 ;~ Global $_hFieldPlus_ToolTip2 Global $_hFieldPlus_hGui Func InputEx_Start($hGui, $sFont = "Tahoma", $iFont = 8) $_sFieldPlus_LabelFont = $sFont $_sFieldPlus_LabelFontSize = $iFont * 0.8 $_sFieldPlus_InputFontSize = $iFont $_hFieldPlus_hGui = $hGui $_hFieldPlus_ToolTip1 = _GUIToolTip_Create($_hFieldPlus_hGui, $TTS_BALLOON); balloon style tooltip ConsoleWrite("$_hFieldPlus_ToolTip1[" & $_hFieldPlus_ToolTip1 & "] @error[" & @error & "]" & @LF) ;~ $_hFieldPlus_ToolTip2 = _GUIToolTip_Create($_hFieldPlus_hGui) ; default style tooltip ;~ ConsoleWrite("$_hFieldPlus_ToolTip2[" & $_hFieldPlus_ToolTip2 & "] @error[" & @error & "]" & @LF) EndFunc ;==>InputEx_Start Func GUICtrlCreateInputEx($sLabel, $sInput, $sTip, $iLeft, $iTop, $iWidth, $iHeight, $sStyle = 0, $sExStyle = 0) Local $hTip = 0 Local $hLabel = GUICtrlCreateLabel($sLabel, $iLeft + 3, $iTop - 12, $iWidth, $iHeight) GUICtrlSetFont($hLabel, $_sFieldPlus_LabelFontSize, 400, 0, $_sFieldPlus_LabelFont) Local $hInput = GUICtrlCreateInput($sInput, $iLeft, $iTop, $iWidth, $iHeight) GUICtrlSetFont($hInput, $_sFieldPlus_InputFontSize, 400, 0, $_sFieldPlus_LabelFont) ;~ If $sTip Then $hTip = _GUIToolTip_AddTool($_hFieldPlus_ToolTip1, $_hFieldPlus_hGui, $sTip, $hInput) ConsoleWrite("_GUIToolTip_AddTool[ " & $hTip & " ] @error[ " & @error & " ]" & @LF) ;~ EndIf If $sStyle Or $sExStyle Then GUICtrlSetStyle($hInput, $sStyle, $sExStyle) ;~ Local $oo = ObjCreate($SD) ;~ $oo.Add($hInput, ObjCreate($SD)) ;~ $oo.Item($hInput).Add("hLabel", $hLabel) ;~ $oo.Item($hInput).Add("sLabel", $sLabel) ;~ $oo.Item($hInput).Add("hTip", $hTip) ;~ $_oFieldPlus.Add($_oFieldPlus.Count + 1, $oo) Return $hInput EndFunc ;==>GUICtrlCreateInputEx Func _FieldPlus_OnExit() _GUIToolTip_Destroy($_hFieldPlus_ToolTip1) ;~ _GUIToolTip_Destroy($_hFieldPlus_ToolTip2) EndFunc ;==>_FieldPlus_OnExit Func InputEx_SetGui($hGui) $_hFieldPlus_hGui = $hGui EndFunc ;==>InputEx_SetGui