Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » Docking: ContexMenu behaviour
Docking: ContexMenu behaviour [message #27541] Thu, 22 July 2010 13:14 Go to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi mrjt,

i noticed, that using Docking in tabbed view, one can close all tabs only, by right klicking some free space (where no tab field), 'Close all others' appears.

here is the general question, if a forwarder to TabBar::ContextMenu should be used in DockTabBar, since user it can break a lot, or do you support closing from TabBar point of view?

in case to look to: (here some proposals, not very thought through

DockTabBar.cpp:51
void DockTabBar::RightDown(Point p, dword keyflags)
{
	if (GetHighlight() >= 0) 
		WhenContext(GetHighlight());	
//no forward outside own tabs
//	else 
//		TabBar::RightDown(p, keyflags);
}


DockTabBar.h:16
	virtual void 	ContextMenu(Bar& bar)			{ /*TabBar::ContextMenu(bar);*/ }



hope it got bi clear
Re: Docking: ContexMenu behaviour [message #27543 is a reply to message #27541] Thu, 22 July 2010 16:08 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
The forwarding is now unnecessary (ContextMenu is exposed in TabBar now) but the concept is correct. Tabs can be closed from the tabbar menu without problems.

Well, in theory anyway. In practice the TabBar close handling had changed since the Docking code was written so I've committed the changes necessary to fix it.

Edit: The next thing you're going to say is 'I need to disable closing of tabs via the TabBar' yes? Smile

[Updated on: Thu, 22 July 2010 16:10]

Report message to a moderator

Re: Docking: ContexMenu behaviour [message #27544 is a reply to message #27543] Thu, 22 July 2010 17:23 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
probably.. Laughing

i'll check it..thanks
Re: Docking: ContexMenu behaviour [message #27567 is a reply to message #27544] Fri, 23 July 2010 13:28 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
it works 'off the shelf' Smile
remains one last thing and i am upstream Smile

http://www.ultimatepp.org/forum/index.php?t=msg&&th= 5276&goto=27532#msg_27533

btw: maybe this addition is helpful, i had a crash once at this point but cant reproduce it..
void TabBar::DoTabSort(TabSort &sort)
{
	if(GetCount()<=0) //<<<
		return;   //<<<
	Value v = GetData();
	StableSort(tabs, sort);
	Repos();
	if (!IsNull(v))
		SetData(v);
	Refresh();
}

[Updated on: Fri, 23 July 2010 13:33]

Report message to a moderator

Re: Docking: ContexMenu behaviour [message #27571 is a reply to message #27567] Fri, 23 July 2010 14:19 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
In such a situation it is better to crash ASAP than abort silently IMO. The code should work if count == 0 and count < 0 indicates that either a) the container has been picked, which I don't think has happenned in this case) or b) There is some memory erorr somewhere else which needs fixing. The function was almost certainly called on a hanging/invalid pointer.
Re: Docking: ContexMenu behaviour [message #27573 is a reply to message #27571] Fri, 23 July 2010 14:38 Go to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
ok, that could probably be..your're right..in most cases its better to fix such problems in dev. stage of app to ensure rightful behaviour towards api.

Previous Topic: Function4U documentation update and misc
Next Topic: Using GoogleMaps from U++
Goto Forum:
  


Current Time: Fri Mar 29 11:23:01 CET 2024

Total time taken to generate the page: 0.01638 seconds