Hi LeifG,
Quote:
Found a solution to that the smiley window stays Always on top when main window is minimized.
Concerning your solution. You don't need that
If (A_EventInfo = 1) within the else block, because the first
if checks for A_EventInfo
not 1, which means that if A_EventInfo is 1, it automatically executes the else block.
Code:
GuiSize:
; If Gui is not minimized
If (A_EventInfo <> 1)
{
GuiIsNotMinimized := true
Anchor("EdtComment" , "wh" )
Anchor("GrpMenuBorder", "w" )
Anchor("GrpCstmBorder", "w" )
Anchor("BtnCustomize" , "x" )
Anchor("ChkSig" , "y" )
Anchor("DDLSig" , "y" )
Anchor("BtnEditSig" , "y" )
Anchor("BtnDelSig" , "y" )
Anchor("BtnSend" , "xy", true)
Anchor("BtnPreview" , "xy", true)
Anchor("BtnReset" , "xy", true)
Anchor("BtnPinned" , "x" )
WinSet, Redraw,, %ScriptName%
Gui, 4:Restore ;Restore Smiley-toolwindow if minimized
}
Else
{
GuiIsNotMinimized := false
Gui, 4:Cancel ;Hides (Minimize) Smiley-toolwindow if open
}
Return
Quote:
Specialy the workaround with the <_<
I assume my workaround is the solution to this problem then?
Quote:
I would actually like to have the same "pinned" function as with the main window.
Why don't you expand the Pinned button subroutine to take control of the 'AlwaysOnTop' option of the smiley gui?
You'll find the BtnPinned routine within BBCodeEditor.ahk
Code:
BtnPinned:
; Find the Window Handle
WinHandle := WinExist(ScriptName)
If PinnedPressed = 0
{
SetButtonGraphic(WinHandle, "18", A_ScriptDir "\phpbb\ico\pinned.ico", 16, 16, IMAGE_ICON)
PinnedPressed = 1
}
Else
{
SetButtonGraphic(WinHandle, "18", A_ScriptDir "\phpbb\ico\unpinned.ico", 16, 16, IMAGE_ICON)
PinnedPressed = 0
}
WinSet, AlwaysOnTop, Toggle, %ScriptName%
WinSet, AlwaysOnTop, Toogle, %lang_gui4_TtlGui4%
Return
Quote:
I haven't dived into the calculation.
But I saw that the window increased with 8 px each closing (saving windows postion and size).
So I just changed that calculation to reduce the height with an additional 8 px.
I will have to use this setting for a while to see if it did the trick.
That's a tricky one. The calculation is needed because the gui is resizable.
At the moment I can't explain the difficulties you have. Do you have this error even when using a fresh install of the source code? Maybe it's a desktop theme issue.
Quote:
By the way are the buttons in the main gui handled the similar way as the smiley button in the Smiley gui?
I think so.
Quote:
Which section do I have to edit in code and briefly the change in each section?
You'll have to adjust the
CreateMainGui subroutine within BBCodeEditor.ahk. Specifically the
; Add Icon Buttons section.
If you're adding glabels to the buttons, you have to create these subroutines too. You'll find the subroutines for the existing buttons below all gui definitions. The section is marked as:
Code:
;##############################################################################
;####### MainGui Button Code ##################################################
;##############################################################################
You probably have to fiddle around with the starting gui width in x direction when adding additional buttons to the existing ones. Otherwise the gui might be too small to show them all at once.
btw. I recognized an error when making the changes to the smiley gui I proposed yesterday. You'll have to check if the smiley gui exists prior to calling the creating subroutine.
Otherwise Autohotkey reports an error when the smiley gui is already in existence and you press the smiley button again. S.th like
Code:
;##############################################################################
;####### Smiley Gui ###########################################################
;##############################################################################
SelectSmiley:
IfWinExist, %lang_gui4_TtlGui4%
WinActivate, %lang_gui4_TtlGui4%
Else
{
Gui, 1:+Disabled
Gui, 4:+owner +ToolWindow +AlwaysOnTop
Gui, 4:Margin, 5, 5
Gui, 4:Add, Text, Section, %lang_gui4_TxtAddSmiley%
Gui, 4:Add, Text, xs+92 ys w52 h18 ReadOnly Right
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley1 xs ys+20 h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley2 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley3 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley4 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley5 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley6 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley7 xs ys+45 h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley8 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley9 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley10 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley11 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley12 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley13 xs ys+70 h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley14 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley15 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley16 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley17 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley18 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley19 xs ys+95 h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley20 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley21 xp+25 yp h22 w22 +%BS_ICON%
Gui, 4:Add, Button, gBtnAddSmiley vBtnAddSmiley22 xp+25 yp h22 w22 +%BS_ICON%
; Create Gui, but hide it for now - due to following icon assignment
Gui, 4:Show, +Hide, %lang_gui4_TtlGui4%
; Wait for Gui Creation
WinWait, %lang_gui4_TtlGui4%
; Find the Window Handle
WinHandle := WinExist(lang_gui4_TtlGui4)
; Assign icons to buttons
SetButtonGraphic(WinHandle, "1", A_ScriptDir "\phpbb\ico\smileys\icon_biggrin.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "2", A_ScriptDir "\phpbb\ico\smileys\icon_smile.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "3", A_ScriptDir "\phpbb\ico\smileys\icon_sad.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "4", A_ScriptDir "\phpbb\ico\smileys\icon_surprised.ico", 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "5", A_ScriptDir "\phpbb\ico\smileys\icon_eek.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "6", A_ScriptDir "\phpbb\ico\smileys\icon_confused.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "7", A_ScriptDir "\phpbb\ico\smileys\icon_cool.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "8", A_ScriptDir "\phpbb\ico\smileys\icon_lol.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "9", A_ScriptDir "\phpbb\ico\smileys\icon_mad.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "10", A_ScriptDir "\phpbb\ico\smileys\icon_razz.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "11", A_ScriptDir "\phpbb\ico\smileys\icon_redface.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "12", A_ScriptDir "\phpbb\ico\smileys\icon_cry.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "13", A_ScriptDir "\phpbb\ico\smileys\icon_evil.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "14", A_ScriptDir "\phpbb\ico\smileys\icon_twisted.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "15", A_ScriptDir "\phpbb\ico\smileys\icon_rolleyes.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "16", A_ScriptDir "\phpbb\ico\smileys\icon_wink.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "17", A_ScriptDir "\phpbb\ico\smileys\icon_exclaim.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "18", A_ScriptDir "\phpbb\ico\smileys\icon_question.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "19", A_ScriptDir "\phpbb\ico\smileys\icon_idea.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "20", A_ScriptDir "\phpbb\ico\smileys\icon_arrow.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "21", A_ScriptDir "\phpbb\ico\smileys\icon_neutral.ico" , 16, 16, IMAGE_ICON)
SetButtonGraphic(WinHandle, "22", A_ScriptDir "\phpbb\ico\smileys\icon_mrgreen.ico" , 16, 16, IMAGE_ICON)
Gui, 4:Show, AutoSize, %lang_gui4_TtlGui4%
; Retrieve scripts PID
Process, Exist
pid_this := ErrorLevel
; Retrieve unique ID number (HWND/handle)
WinGet, hw_gui, ID, ahk_class AutoHotkeyGUI ahk_pid %pid_this%
; Call "ShowSmileTooltip" when script receives WM_MOUSEMOVE message
WM_MOUSEMOVE = 0x200
OnMessage(WM_MOUSEMOVE, "HandleMessage")
}
Return
______________________
Cheers AGU