Alright so i figured out how to make a nice working one now. Hadn't revisited this in a while. I used Infogulch's Placeholder script for some visual Aesthetic.
Code: Select all
; Placeholder() - by infogulch for AutoHotkey v1.1.05+
;
; to set up your edit control with a placeholder, call:
; Placeholder(hwnd_of_edit_control, "your placeholder text")
;
; If called with only the hwnd, the function returns True if a
; placeholder is being shown, and False if not.
; isPlc := Placeholder(hwnd_edit)
;
; to remove the placeholder call with a blank text param
; Placeholder(hwnd_edit, "")
;
; http://www.autohotkey.com/forum/viewtopic.php?p=482903#482903
;
Placeholder(wParam, lParam = "`r", msg = "") {
static init := OnMessage(0x111, "Placeholder"), list := []
if (msg != 0x111) {
if (lParam == "`r")
return list[wParam].shown
list[wParam] := { placeholder: lParam, shown: false }
if (lParam == "")
return "", list.remove(wParam, "")
lParam := wParam
wParam := 0x200 << 16
}
if (wParam >> 16 == 0x200) && list.HasKey(lParam) && !list[lParam].shown ;EN_KILLFOCUS := 0x200
{
GuiControlGet, text, , %lParam%
if (text == "")
{
Gui, Font, Ca0a0a0
GuiControl, Font, %lParam%
GuiControl, , %lParam%, % list[lParam].placeholder
list[lParam].shown := true
}
}
else if (wParam >> 16 == 0x100) && list.HasKey(lParam) && list[lParam].shown ;EN_SETFOCUS := 0x100
{
Gui, Font, cBlack
GuiControl, Font, %lParam%
GuiControl, , %lParam%
list[lParam].shown := false
}
}
^!Numpad1::
Gui, 3: Show, w120 h140, OpsDeland
Gui, 3: Add, Edit, w80 vBTN hwndhBtn
Gui, 3: Add, Edit, w80 vSO hwndhSO#
Gui, 3: Add, Edit, w80 vDate hwndhDueDate
Gui, 3: Add, Checkbox, vDispatch, Dispatch Needed?
Gui, 3: Add, Button,gGenerate, Generate Subject
Placeholder(hBtn, "BTN")
Placeholder(hSO#, "SO#")
Placeholder(hDueDate, "Due Date")
return
Generate: ;;Switched to G-Labels as they made everything more clear and work well.
Gui, Submit, NoHide
If Dispatch
{
Clipboard = URGENT Order Jeopardy - %BTN% - %SO% - Due %Date% - Dispatch Needed
;Gui, 3:Destroy ((Commenting this out prevented the information from being lost After clicking Generate))
}
Else
{
Clipboard = URGENT Order Jeopardy - %BTN% - %SO% - Due %Date% - Does not need Dispatch
;Gui, 3:Destroy
}
;MsgBox,, Clipboard, %Clipboard%, 3
Return
3GuiClose:
Gui, 3:Destroy
Return
Sorry for not posting this update much sooner.