AutoHotkey Community

It is currently May 26th, 2012, 4:48 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 273 posts ]  Go to page Previous  1 ... 13, 14, 15, 16, 17, 18, 19  Next
Author Message
 Post subject:
PostPosted: March 23rd, 2008, 6:48 am 
Offline

Joined: March 23rd, 2008, 5:22 am
Posts: 12
Well!

I've implemented an other set of Smileys.

One of the Smileys are using this "tag" <_< to be displayed at geekstogo.

But the previewer doesn't display it.

I found the following lines in BBCodePreview.ahk

Code:
; Convert HTML sensitive chars ###############################################
  StringReplace, bbcode, bbcode, &, &amp`;, All
  ;StringReplace, bbcode, bbcode, <, &lt`;, All
  StringReplace, bbcode, bbcode, >, &gt`;, Al


If I disable the middle line the Smiley is displayed in Preview.

Is there a work around or what is the consequences of comment that line out?

I changed the code so that the toolwindow with Smileys doesn't get closed until you click the close mark.

Here is what I did I commented out a line in this section of GUI 4

Code:
BtnAddSmiley:
  StringTrimLeft, SmileyNumber, A_GuiControl, 12
  Smiley := ArrayOfSmileys%SmileyNumber%
  ;GoSub, 4GuiClose
  GuiControl, 1:Focus, EdtComment
  Control, EditPaste, %Smiley%, Edit1, %ScriptName%
Return


The problem is that GUI 4 stays op Always on top When I minimize the main window.

Is there a way to minimize the toolwindow (GUI 4) as you minimize the main window (GUI 1) and also to restore them?

Leif

PS. I Just followed the Instructions here to change the set of Smileys. So I'm not familiar with AHK.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2008, 7:22 am 
Offline

Joined: March 23rd, 2008, 5:22 am
Posts: 12
Figured one issue out my self. But I don't know if it's the proper way to handle windows

Here is what I added

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
  If (A_EventInfo = 1)
    {
   GuiIsNotMinimized := false
   Gui, 4:Cancel                     ;Minimize Smiley-toolwindow if open
   }
Return


Still the problem with the smiley though.

LeifG


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2008, 1:55 pm 
Offline

Joined: March 23rd, 2008, 5:22 am
Posts: 12
It wasn't that easy :(

The main window grow out of proportions downwards.

Somehow the values in BBCodeEditor.ini are change in strange ways

Maybe because I am manipulating one window from within an other.

Can The +Focus be used in som way here to prevent information from Gui 4 interfere with Gui 1?

Maybe It's because the wrong windows in focus when values are to be stored in BBCodeEditor.ini?

Has anyone a clue to this?

LeifG


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2008, 2:11 pm 
Quote:
One of the Smileys are using this "tag" <_< to be displayed at geekstogo.
But the previewer doesn't display it.
Of course not. As the character < will be replaced by StringSplit with &lt;. That's part of the preview event - it'll change/convert BBCode to HTML. So a set <_<-smiley should end up as a &lt;_&lt;. That won't give you a smile(y), right? :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2008, 2:32 pm 
Offline

Joined: March 23rd, 2008, 5:22 am
Posts: 12
Yeah!

I realizes that also.
Sorry I'm new to BBCode.
Where in the BBCode are < and > used that has to be converted to &lt; and &gt; in HTML?

What is the consequences if I comment out that line.
Remember I'm only using BBCodeWriter offline to compose and preview the post.
Then I just copy/paste when I'm posting.

Has anyone an idea to how I can minimize both Gui 1 and Gui 4.
My quick and obviously dirty way in an earlier post didn't work as somewhere along the way things are written to BBCodeWriter.ini. Wrong values gets in to the file. Probably because two windows are open. And the one in focus is saved and then wrong values get written to the ini-file.

I don't know if I'm on the right track here.
Can someone help me with this please?

LeifG


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2008, 2:44 pm 
I'd be happy if the community would sponsor [HotEditor] (keycode for 1 domain: $27.95), which can be easilly embbeded within any (phpBB/..) forum, and of course used offline as well. :wink:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2008, 3:00 pm 
Offline

Joined: March 23rd, 2008, 5:22 am
Posts: 12
Looks like the height of the main window is incremented with 8 every time it gets closed.

Has anyone this behavior ( running from source code)

I'll try to change the calculation of the actul windowsize to see what the effect is.

LeifG


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2008, 4:18 pm 
Offline

Joined: March 23rd, 2008, 5:22 am
Posts: 12
Well BoBo"

I downloaded it and It didn't work in IE nor in Firefox. No smileys and lots of other windows that should have poped up. But only windows with PHP errorcode in them

This seems to be an unstable and crappy editor to me

LeifG


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2008, 7:06 pm 
Hi LeifG,
Quote:
If I disable the middle line the Smiley is displayed in Preview.
These lines were a result of an error report.
:arrow: http://www.autohotkey.com/forum/post-42651.html#42651

It's a workaround to avoid displaying errors when entering raw html code within the edit control.

Quote:
Is there a work around or what is the consequences of comment that line out?
A workaround could be to alter the 'smiley replacement' of your special smiley so that it replaces the resulting string of the 'sensitive html chars' replacement (BBCodePreview.ahk)

Code:
  ; Convert Smileys  ###########################################################
  StringReplace, bbcode, bbcode, &lt`;_&lt`;, <img src="phpbb/smileys/yoursmiley.gif" alt="YourDescription" />, All
  StringReplace, bbcode, bbcode, :idea:, <img src="phpbb/smileys/icon_idea.gif" alt="Idea" />, All
...


Quote:
The problem is that GUI 4 stays op Always on top When I minimize the main window.
This is because of the 'AlwaysOnTop' option set when creating Gui4. Maybe it helps to remove the option. You'll find it within BBCodeEditor.ahk
Code:
;##############################################################################
;####### Smiley Gui ###########################################################
;##############################################################################
SelectSmiley:
  Gui, 1:+Disabled
  Gui, 4:+owner +ToolWindow +AlwaysOnTop
  Gui, 4:Margin, 5, 5
...
Just give it a try and remove this option.

I would also delete the line 'Gui, 1:+Disabled' to avoid diasabling the main gui when opening the smiley gui. Same goes for 4GuiClose subroutine.
Code:
;##############################################################################
;####### Smiley Gui ###########################################################
;##############################################################################
SelectSmiley:
  Gui, 4:+owner +ToolWindow
  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

BtnAddSmiley:
  StringTrimLeft, SmileyNumber, A_GuiControl, 12
  Smiley := ArrayOfSmileys%SmileyNumber%
  GuiControl, 1:Focus, EdtComment
  Control, EditPaste, %Smiley%, Edit1, %ScriptName%
Return

4GuiClose:
  Gui, 4:Destroy
Return
;##############################################################################
;####### End of Smiley Gui ####################################################
;##############################################################################



Quote:
Is there a way to minimize the toolwindow (GUI 4) as you minimize the main window (GUI 1) and also to restore them?
As you already found out, the magic has to take place within the GuiSize routine of the main GUI. :)

Have you tried this?
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
    }
  Else
    {
      GuiIsNotMinimized := false
      Gui, 4:Minimize
    }
Return

____________________
Cheers AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2008, 7:10 pm 
btw. I added a little reset hotkey in case the window calculation gets screwed up. Just press 'Ctrl + Shift + End' to overwrite the values within BBCodeWriter.ini with standard values again.

You'll find the hotkey within hotkeys.ahk in case you want to change the hotkey to another combination.
______________________
Cheers AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 24th, 2008, 9:19 am 
Offline

Joined: March 23rd, 2008, 5:22 am
Posts: 12
Thanks for the answers
I feel privileged, cause there was a while since you posted here.

Specialy the workaround with the <_< :) .

I want to have Smiley window on top when its open - for now.
I would actually like to have the same "pinned" function as with the main window. Haven't had time to look in to this.
Maybe you have a suggestions for that?

:idea: Found a solution to that the smiley window stays Always on top when main window is minimized.

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
  If (A_EventInfo = 1)
    {
   GuiIsNotMinimized := false
   Gui, 4:Cancel                     ;Hides (Minimize) Smiley-toolwindow if open
   }
Return
[/code]

Oh, and of course I commented out disabling Gui1 when Gui4 is open.

About the window calculation.
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.

By the way are the buttons in the main gui handled the similar way as the smiley button in the Smiley gui?
I'm asking because I'm thinking about adding a few as pemanent. I know that I can add custom ones, but I want the permanent.

Which section do I have to edit in code and briefly the change in each section?

Again may thanks :D

LeifG


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 24th, 2008, 5:21 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2008, 9:07 am 
Offline

Joined: March 23rd, 2008, 5:22 am
Posts: 12
Thanks AGU!
I'll try fix my own buttons later. I'll just have to stick with the custom buttons, I'm focusing on the smileys for now

Some question.

Is it possible to use gif-images (animated) for the buttons in the smiley-window or must it be ico-images?

It sometimes difficult to choose an unanimated image to represent an animated one.

Can I extend the number of custom button?
It would probably be easier than add new regular buttons, or?

I didn't quite understand the instuction to get a pinned button always on top in the smiley window to work correctly. Can the same subroutine be used for both windows. How do I change the button icon in the smiley-window (now the smiley in main-window are changed when clicking the button in smiley-window.

Any Ideas?

LeifG


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2008, 10:02 pm 
Hi LeifG,

Quote:
Is it possible to use gif-images (animated) for the buttons in the smiley-window or must it be ico-images?
As far as I know Windows standard button controls don't support animated gifs.

I'm using corrupts graphic buttons code. This function in fact only supports .ico and .bmp graphics. That's why I stick with .ico files within BBCodeWriter. So concerning your question I would say no, that's not possible.

A very rough idea would be to completely redesign the smiley gui and use picture controls instead of buttons. As far as I know, picture controls support animated gifs.
I don't know if it's possible to do it. You'll have to fiddle about yourself.

Quote:
Can I extend the number of custom button?
Hmm, that's a difficult question. I think it's as difficult as adding regular buttons, because for the custom buttons you would have to make changes in multiple sections as well.

Beginning with the whole
Code:
;##############################################################################
;####### Custom Buttons GUI ###################################################
;##############################################################################

section where you have to add your additional buttons within CreateCstmBtnsGUI. You also have to add an extra subroutine for every button you create.

I think the best thing would be to study the mentioned code, to get a feeling how it works. If you'll get it, it's not very difficult to add more buttons.

Same thing about
Code:
;##############################################################################
;###### Custom BBCode Tags from CustomTags.ini ################################
;##############################################################################
section, where you have to add entries for all buttons you create.

Within CreateMainGui subroutine you'll have to add your additional custom buttons within:
Code:
...
  If CstmBarEnabled = 1
    { 
      ; Borderline between IconButtons and Custom buttons
      Gui, 1:Add, GroupBox, vGrpCstmBorder xm ym+23 Section w%GrpW% h8
     
      ; Add Custom Buttons
      Gui, 1:Add, Button, gBtnCustom1   vBtnCustom1  xm ys+11 h25 w25 +%BS_ICON%
      Gui, 1:Add, Button, gBtnCustom2   vBtnCustom2  xp+28 yp h25 w25 +%BS_ICON%
      Gui, 1:Add, Button, gBtnCustom3   vBtnCustom3  xp+28 yp h25 w25 +%BS_ICON%
      Gui, 1:Add, Button, gBtnCustom4   vBtnCustom4  xp+28 yp h25 w25 +%BS_ICON%
      Gui, 1:Add, Button, gBtnCustom5   vBtnCustom5  xp+28 yp h25 w25 +%BS_ICON%
      Gui, 1:Add, Button, gBtnCustom6   vBtnCustom6  xp+28 yp h25 w25 +%BS_ICON%
      Gui, 1:Add, Button, gBtnCustom7   vBtnCustom7  xp+28 yp h25 w25 +%BS_ICON%
      Gui, 1:Add, Button, gBtnCustom8   vBtnCustom8  xp+28 yp h25 w25 +%BS_ICON%
      Gui, 1:Add, Button, gBtnCustom9   vBtnCustom9  xp+28 yp h25 w25 +%BS_ICON%
      Gui, 1:Add, Button, gBtnCustom10  vBtnCustom10 xp+28 yp h25 w25 +%BS_ICON%
      Gui, 1:Add, Button, gBtnCustomize vBtnCustomize x%BG3X% yp+3 h20 w60, %lang_gui1_BtnCustomize%
    }
...


You see, it's no easy task. ;)

Quote:
I didn't quite understand the instuction to get a pinned button always on top in the smiley window to work correctly. Can the same subroutine be used for both windows.
So you thought of an "Pinned button" within Smiley GUI.

My instruction was just to use the pinned function from the main gui. So when you pin the main gui, the smiley gui gets pinned as well.
This means, when pushing the pinned button of the main gui, the script sets the "AlwaysOnTop" option for the smiley gui as well.

If you want a seperate pinned button for the smiley gui, this would mean changes have to be made to GUI4 (smiley gui). The only advantage of such a solution would be, that the smiley gui could be pinned on its own without paying attention to the main gui. Tell me what you think.

Quote:
How do I change the button icon in the smiley-window (now the smiley in main-window are changed when clicking the button in smiley-window.
I'm not sure if I understand this right. But I have explained how to change the button smileys to another user (DaveM59) some pages before. Maybe it's of any help.

http://www.autohotkey.com/forum/post-78153.html#78153
http://www.autohotkey.com/forum/post-78415.html#78415
____________________
Cheers AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2008, 11:55 pm 
Offline

Joined: March 23rd, 2008, 5:22 am
Posts: 12
Thanks a lot!

I'll be busy for some time now.
But I sure is gonna try your suggestions.

I'll be back later to let you know if I succeded.

LeifG


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 273 posts ]  Go to page Previous  1 ... 13, 14, 15, 16, 17, 18, 19  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: JamixZol and 10 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group