AutoHotkey Community

It is currently May 27th, 2012, 6:54 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 136 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9, 10  Next
Author Message
 Post subject: GUI Menu Instance
PostPosted: September 29th, 2011, 6:41 pm 
Offline

Joined: March 18th, 2008, 4:04 am
Posts: 193
"CMENU"

fragman,

in your example you use "CMENU"
where is the Instance (new) of CMENU ?

or it's build in ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 29th, 2011, 9:08 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
It's included in the library, CMenu.ahk.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 30th, 2011, 5:54 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
I started writing a small file manager using my library as a more advanced example:Image

It's working fine so far, it's just a bit quirky and does not display the virtual directory structure but only a drive list in the tree. I might add more features if there is a demand.

I also fixed some more bugs while writing this.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 1st, 2011, 8:11 am 
Offline

Joined: December 19th, 2010, 5:32 am
Posts: 235
With the latest version, I am not getting events for the tab control.
Example:
Code:
gui := new Form1()
#include <CGUI>
Class Form1 Extends CGUI
{
   
   __New()
   {
        this.tabControl1 := this.AddControl("Tab", "tabControl1", "x12 y12 w496 h377", "Settings|Noting")
      this.Title := "Form1"
      this.Show()
   }
   
    tabControl1_Click(TabItem)
    {
        MsgBox % TabItem
    }
   
    DoubleClick(TabItem)
    {
        MsgBox % "Double Click: " . TabItem
    }
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 1st, 2011, 9:36 am 
Try tabitem.text. you can't print an object. I changed some events to pass an object rather than an index.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 1st, 2011, 7:13 pm 
Offline

Joined: December 19th, 2010, 5:32 am
Posts: 235
The event is still not being called.
Also the HandleEvent function in tab control is being sent a blank parameter when ever I click the tab.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 2nd, 2011, 7:40 am 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
OK, I'll check tomorrow evening, I'm not home right now.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 3rd, 2011, 10:59 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
I pushed a fix, there was an additional "_" in the event name :twisted:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2011, 12:26 am 
Offline

Joined: December 19th, 2010, 5:32 am
Posts: 235
The click message is working now but, I still can't get the tabindex from the click event.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2011, 12:37 am 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
You're right, sorry that I didn't test properly...
It should be fine now, I tried and the item was passed and I could access the "Text" property.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2011, 12:47 am 
Offline

Joined: December 19th, 2010, 5:32 am
Posts: 235
Thanks, for the quick repsonse. I managed to get it working, but I believe I found another bug.
When right clicking on a control it seems ContextMenu() is no longer being called.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2011, 12:48 am 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
That's intended. Controls have their own ControlName_ContextMenu() event now. The main ContextMenu() event will only get called if the user right clicks on empty space in the window.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2011, 12:50 am 
Offline

Joined: December 19th, 2010, 5:32 am
Posts: 235
Oh OK, thanks for clearing that up.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2011, 7:25 am 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
You can also set GUI.Menu and Control.Menu to an instance of CMenu if you want to use a static menu. Just make sure not to handle those events then.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2011, 4:35 am 
Offline

Joined: December 19th, 2010, 5:32 am
Posts: 235
I can't get the menu example to work. I am trying to get the Gui to own a menu by
Code:
this.Menu(this.Menu1)
but the Menu is not being shown.
Am I doing this wrong or did something change again?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 136 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9, 10  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 4 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