AutoHotkey Community

It is currently May 27th, 2012, 4:30 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 352 posts ]  Go to page Previous  1 ... 19, 20, 21, 22, 23, 24  Next
Author Message
 Post subject:
PostPosted: February 13th, 2010, 2:20 pm 
I have used v2.0b3 to make the background layer stay behinde the layer text.

But I can figure it out how to move both of them holding L mouse button :(


Code:
#SingleInstance force
SetWinDelay -1


Gui, 3:+LastFound -Caption +ToolWindow
Gui, 3:Color, red
Gui, 3:Add, Text, s9 cGreen w700 , background layer
Gui, 3:Show, w200 h200,Win_Background
w3 := WinExist(Win_Background)

Gui, 4:+LastFound -Caption +ToolWindow +border
Gui, 4:Color, black
Gui, 4:Add, Text, s9 cGreen w700 , text layer text layer text layer text layer`n text layer text layer text layer text layer`n text layer text layer text layer text layer`n text layer text layer text layer text layer`n
Gui, 4:Show,w120 h60, Win_Text
Dock_HostID := WinExist(Win_Text)


;###### Tweaking
Gui, 3:+LastFound 
WinSet, Transparent, 245 , Win_Background
WinSet, Region, 0-0 W200 h200 R20-20, Win_Background

Gui, 4:+LastFound 
WinSet, TransColor, black 100, Win_Text 
   

;###### Docking
Dock(w3, "x(0,0,-20) y(0,0,-20) ") ;w(1,40) h(1,40) t


;###### Move window without caption
OnMessage(0x201, "WM_LBUTTONDOWN")
WM_LBUTTONDOWN()
{
         IfWinNotActive, Win_Text
   PostMessage, 0xA1, 2
         ;IfWinNotActive, Win_Background
   ;PostMessage, 0xA1, 2         
}
return


#include Dock.ahk
~esc::exitapp


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2010, 2:44 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Use the oposite:


Code:
#SingleInstance force
SetWinDelay -1
SetBatchLines, -1


Gui, 3:+LastFound -Caption +ToolWindow
Gui, 3:Color, red
Gui, 3:Add, Text, s9 cGreen w700 , background layer
Gui, 3:Show, w200 h200,Win_Background
Dock_HostID := WinExist(Win_Background)

Gui, 4:+LastFound -Caption +ToolWindow +border
Gui, 4:Color, black
Gui, 4:Add, Text, s9 cGreen w700 , text layer text layer text layer text layer`n text layer text layer text layer text layer`n text layer text layer text layer text layer`n text layer text layer text layer text layer`n
Gui, 4:Show,w120 h60, Win_Text
w3 := WinExist()


;###### Tweaking
Gui, 3:+LastFound 
WinSet, Transparent, 245 , Win_Background
WinSet, Region, 0-0 W200 h200 R20-20, Win_Background

Gui, 4:+LastFound 
WinSet, TransColor, black 100, Win_Text 
   

;###### Docking
Dock(w3, "x(0,0,20) y(0,0,20) t") ;w(1,40) h(1,40) t


;###### Move window without caption
OnMessage(0x201, "WM_LBUTTONDOWN")
WM_LBUTTONDOWN()
{
         IfWinNotActive, Win_Text
   PostMessage, 0xA1, 2
         ;IfWinNotActive, Win_Background
   ;PostMessage, 0xA1, 2         
}
return


#include Dock.ahk
~esc::exitapp

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2010, 2:48 pm 
Ahaaaaaa... :)
Ty sir, works well


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2010, 2:59 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
However, since you are using primarlly AHK GUIs, its better to use DockA (and much smoother):

Code:
#SingleInstance force
SetWinDelay -1
SetBatchLines, -1


Gui, 3:+LastFound -Caption +ToolWindow
Gui, 3:Color, red
Gui, 3:Add, Text, s9 cGreen w700 , background layer
Gui, 3:Show, w200 h200,Win_Background
Dock_HostID := WinExist(Win_Background)

Gui, 4:+LastFound -Caption +ToolWindow +border
Gui, 4:Color, black
Gui, 4:Add, Text, s9 cGreen w700 , text layer text layer text layer text layer`n text layer text layer text layer text layer`n text layer text layer text layer text layer`n text layer text layer text layer text layer`n
Gui, 4:Show,w120 h60, Win_Text
w3 := WinExist()


;###### Tweaking
Gui, 3:+LastFound 
WinSet, Transparent, 245 , Win_Background
WinSet, Region, 0-0 W200 h200 R20-20, Win_Background

Gui, 4:+LastFound 
WinSet, TransColor, black 100, Win_Text 
   

;###### Docking
DockA(Dock_HostID, w3, "x(0,0,20) y(0,0,20) t") ;w(1,40) h(1,40) t


;###### Move window without caption
OnMessage(0x201, "WM_LBUTTONDOWN")
WM_LBUTTONDOWN()
{
         IfWinNotActive, Win_Text
   PostMessage, 0xA1, 2
         ;IfWinNotActive, Win_Background
   ;PostMessage, 0xA1, 2         
}
return


#include DockA.ahk
~esc::exitapp

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2010, 3:06 pm 
However,if I will replace the text in 'text layer' with a picture, I cant grab and move it no more, but only by click and drag the background.
That is in v2.0b3. I will test DockA now


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2010, 3:12 pm 
No, DockA isn't working neither on text, nor picture.
Better v2.0b3. At least is working on text


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2010, 4:25 pm 
The stuff you are talking about are not related to docking.
Also, it works. I posted you above DockA sample that works on your code.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2010, 4:27 pm 
Its important to realize DockHost movement is important, not client movement. When host moves, client moves. When client moves host does nothing. Thats docking. You obviously want to merge 2 guis as single up so docking might not be appropriate solution for you.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2010, 8:04 pm 
I'm sorry.
I understand.
Any suggestion for a better approach ?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2010, 8:21 pm 
that's it!..^0x00000020 - click through text layer :lol:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2010, 5:08 pm 
Offline

Joined: November 14th, 2007, 2:47 pm
Posts: 335
Location: London, England
Hey Maj,

I have this test script that will attach a GUI dock when a new instance of Notepad is created.

Do you have an idea of how to create another dock if another notepad window is opened?

So far, it only works for one instance.

Thanks for the Dock function.

Code:
#Persistent
SetBatchLines, -1
Process, Priority,, High

Gui +LastFound
hWnd := WinExist()

DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
Return



ShellMessage( wParam,lParam ) {
   Global
  If ( wParam = 1 ) ;  HSHELL_WINDOWCREATED := 1
     {
       WinGetClass, class, ahk_id %lParam%
       If  ( class = "Notepad" )
         {
         Dock_HostID := WinExist("ahk_id " . lParam)
         ;MsgBox, %Dock_HostID%

         Gui +LastFound +ToolWindow -Caption
         Gui, 1:Show, w1000 h28, Test
         c1 := WinExist()
         Dock(c1, "x(0,0,0) y(0,0,48) t")
         
         }
     }
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2010, 6:45 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
You can't have more then 1 dock host with this module.
The closest you can get is to make clients jump to another notepad when it gets activated.

I plan to allow multiple hosts and dynamic hosts (i.e. function that returns true if window is host or false if its not) in the future versions.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2010, 12:34 pm 
Offline

Joined: November 14th, 2007, 2:47 pm
Posts: 335
Location: London, England
majkinetor wrote:
The closest you can get is to make clients jump to another notepad when it gets activated.


That sounds very good too.

What would I need to add to get it to switch?

A SetTimer?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2010, 5:06 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Just change Dock_HostId when you detect new notepad is activen and call Dock_Update.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2010, 1:27 pm 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1934
Location: Germany
I just tested this library and it is great. But first it did not work until I looked at the source. It contains subroutines which ends the the AutoExec section if I include it at the beginning of my script (like I do it allways).
I think at least there should be a requirement or limitation notice about that. May be some other are already irritated and gave up trying.

Isn`t it possible to wrap them out in functions? I see you are using SetTimer. I would appreciate if you find a way to avoid global subroutines. Would it work to put them in the function itself?? I tried a simple test of _Test2.ahk. But I dont know if there is any hidden bug because of that change.

Now I see a real world need and usage of SetTimers with function calls.

_________________
{1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <--


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 352 posts ]  Go to page Previous  1 ... 19, 20, 21, 22, 23, 24  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 9 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