Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-10

Tab/Page controls and popup menus

7 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Brad Campbell

G'day Guys,

Is there a TTabControl or TPageControl style control I can use where I can assign a popupmenu to the actual tab area? Both TTabControl and TPageControl seem to give me a popup with the list of tab names there, but I can't get the user assigned popup menu to have any affect in that area.

It works perfectly in the client area though..

Regards,
Brad

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish.

Reply by email

Mattias Gaertner
to Brad Campbell
Show quoted text 7 lines
G'day Guys, Is there a TTabControl or TPageControl style control I can use where I can assign a popupmenu to the actual tab area? Both TTabControl and TPageControl seem to give me a popup with the list of tab names there, but I can't get the user assigned popup menu to have any affect in that area.

It is a todo to add the popup menu to this gtk menu.

It works perfectly in the client area though..

Mattias

Reply by email

Brad Campbell
to Mattias Gaertner
Mattias Gaertner wrote 12 lines
On Wed, 08 Oct 2008 21:10:38 +0400 Brad Campbell wrote: > G'day Guys, > > Is there a TTabControl or TPageControl style control I can use where > I can assign a popupmenu to the actual tab area? Both TTabControl and > TPageControl seem to give me a popup with the list of tab names > there, but I can't get the user assigned popup menu to have any > affect in that area. It is a todo to add the popup menu to this gtk menu.

Right, yes I just tested in on Win32 under Wine and it works perfectly. I'll have a look and see if I can get a clue :)

Regards,
Brad

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish.

Reply by email

Mattias Gaertner
to Brad Campbell
Show quoted text 16 lines
Mattias Gaertner wrote: > On Wed, 08 Oct 2008 21:10:38 +0400 > Brad Campbell wrote: > >> G'day Guys, >> >> Is there a TTabControl or TPageControl style control I can use >> where I can assign a popupmenu to the actual tab area? Both >> TTabControl and TPageControl seem to give me a popup with the list >> of tab names there, but I can't get the user assigned popup menu >> to have any affect in that area. > > It is a todo to add the popup menu to this gtk menu. Right, yes I just tested in on Win32 under Wine and it works perfectly.

They have tabs in the popup menu?

I'll have a look and see if I can get a clue :)

Mattias

Reply by email

Brad Campbell
to Brad Campbell: Right, yes I just tested in on Win32 under Wine and it works perfectly. I'll have a look…
Brad Campbell wrote 15 lines
Mattias Gaertner wrote: > On Wed, 08 Oct 2008 21:10:38 +0400 > Brad Campbell wrote: > >> G'day Guys, >> >> Is there a TTabControl or TPageControl style control I can use where >> I can assign a popupmenu to the actual tab area? Both TTabControl and >> TPageControl seem to give me a popup with the list of tab names >> there, but I can't get the user assigned popup menu to have any >> affect in that area. > It is a todo to add the popup menu to this gtk menu. Right, yes I just tested in on Win32 under Wine and it works perfectly. I'll have a look and see if I can get a clue :)

This makes it work for me in my application and in the lazarus editor (although I think the menus are now somewhat mismatched for the tab purpose). I can now determine which tab the menu was opened on using IndexOfTabAt()

I don't know if it's the *right* fix.. but it's working here.

Regards,
Brad

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish. -------------- next part -------------- A non-text attachment was scrubbed... Name: laz.diff Type: text/x-diff Size: 552 bytes Desc: not available Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20081009/b95ae49f/attachment.bin

Reply by email

Brad Campbell
to Mattias Gaertner: On Wed, 08 Oct 2008 22:37:57 +0400 They have tabs in the popup menu? Mattias
Mattias Gaertner wrote 19 lines
On Wed, 08 Oct 2008 22:37:57 +0400 Brad Campbell wrote: > Mattias Gaertner wrote: >> On Wed, 08 Oct 2008 21:10:38 +0400 >> Brad Campbell wrote: >> >>> G'day Guys, >>> >>> Is there a TTabControl or TPageControl style control I can use >>> where I can assign a popupmenu to the actual tab area? Both >>> TTabControl and TPageControl seem to give me a popup with the list >>> of tab names there, but I can't get the user assigned popup menu >>> to have any affect in that area. >> It is a todo to add the popup menu to this gtk menu. > Right, yes I just tested in on Win32 under Wine and it works > perfectly. They have tabs in the popup menu?

Err, no.. I have a TTabControl on a form and when I assign a PopupMenu to it I get the menu whether I right-click on the client area, or the tab. GTK2 was giving me a list of tabs when I right-clicked on the tab but the PopupMenu when I right-clicked in the client area.

With the patch attached to my other mail, GTK2 behaves the same as Win32.

Regards,
Brad

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish.

Reply by email

Brad Campbell
to Mattias Gaertner: On Wed, 08 Oct 2008 22:37:57 +0400 They have tabs in the popup menu? Mattias
Mattias Gaertner wrote 15 lines
On Wed, 08 Oct 2008 22:37:57 +0400 Brad Campbell wrote: > Mattias Gaertner wrote: >> On Wed, 08 Oct 2008 21:10:38 +0400 >> Brad Campbell wrote: >> >>> G'day Guys, >>> >>> Is there a TTabControl or TPageControl style control I can use >>> where I can assign a popupmenu to the actual tab area? Both >>> TTabControl and TPageControl seem to give me a popup with the list >>> of tab names there, but I can't get the user assigned popup menu >>> to have any affect in that area. >> It is a todo to add the popup menu to this gtk menu.

Oh, sorry. I understand now, you want to add the user menu to the end of the existing menu. Best disregard my patch then.

I'll have a think about that.
Personally I'm not hot on the idea. It's not compatible with the way Delphi does it.

I'd rather have built a custom popupmenu that has the tab list and the other desired items on it should you want to have a list of tabs to select.

Regards,
Brad

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish.

Reply by email