Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Multiline popups in GridCtrl
Re: Multiline popups in GridCtrl [message #23776 is a reply to message #23754] |
Fri, 20 November 2009 15:59   |
Zbych
Messages: 327 Registered: July 2009
|
Senior Member |
|
|
Another problem. In my application I use WhenCursor callback to enable/disable ToolBar. Inside this callback I check if any row is selected by calling IsCursor. The problem is that IsCursor gives incorrect state of cursor at that time (probably WhenCursor callback is executed to early in GridCtrl::SetCursor0).
Steps:
1. click add
2. click on some row - tool bar should be enabled (but it is not)
3. click second time - now tool bar is enabled.
4. click clear - now grid is empty, but callback is not executed (in my opinion should be, because cursor is gone) and tool bar is not deactivated.
Test code:
struct App : public TopWindow
{
typedef App CLASSNAME;
Button ok;
Button clear;
ToolBar tool;
GridCtrl grid;
void AddToGrid();
void ClearGrid();
void MyToolBar(Bar& bar);
void ToolBarRefresh();
App();
};
App::App()
{
Sizeable();
grid.HSizePosZ(10,10);
tool.Set(THISBACK(MyToolBar));
AddFrame(tool);
Add(grid.SizePos().HSizePos(0,0).VSizePosZ(0,50));
grid.AddColumn( "Name").DoSum("%d");
grid.AddColumn( "Surname").DoSum("%d");
grid.WhenCursor = THISBACK(ToolBarRefresh);
ok.WhenPush = THISBACK(AddToGrid);
clear.WhenPush = THISBACK(ClearGrid);
ok.SetLabel(t_("Add")).HCenterPosZ(76, -84).BottomPosZ(8, 32);
clear.SetLabel(t_("Clear")).HCenterPosZ(76, 80).BottomPosZ(8, 32);
Add(ok);
Add(clear);
}
void App::AddToGrid(){
for(int l=0; l<5; l++){
grid.Add(l, Format("Row %d\nRow %d\nRow %d\n", l,l,l));
}
}
void App::ClearGrid()
{
grid.Clear();
}
void App::MyToolBar(Bar& bar)
{
bar.Add(grid.IsCursor(), "File", Image::Wait() , THISBACK(ClearGrid));
bar.Add(grid.IsCursor(), "File", Image::Wait() , THISBACK(ClearGrid));
}
void App::ToolBarRefresh()
{
tool.Set(THISBACK(MyToolBar));
Beep(1000,100);
}
GUI_APP_MAIN
{
App app;
app.Run();
}
|
|
|
 |
|
Multiline popups in GridCtrl
By: Zbych on Wed, 21 October 2009 11:36
|
 |
|
Re: Multiline popups in GridCtrl
By: unodgs on Wed, 21 October 2009 12:24
|
 |
|
Re: Multiline popups in GridCtrl
By: zsolt on Tue, 03 November 2009 15:16
|
 |
|
Re: Multiline popups in GridCtrl
By: unodgs on Tue, 03 November 2009 20:45
|
 |
|
Re: Multiline popups in GridCtrl
By: Zbych on Wed, 04 November 2009 15:55
|
 |
|
Re: Multiline popups in GridCtrl
By: unodgs on Thu, 05 November 2009 00:41
|
 |
|
Re: Multiline popups in GridCtrl
By: Zbych on Thu, 05 November 2009 08:18
|
 |
|
Re: Multiline popups in GridCtrl
By: unodgs on Thu, 05 November 2009 11:52
|
 |
|
Re: Multiline popups in GridCtrl
By: Zbych on Mon, 09 November 2009 11:56
|
 |
|
Re: Multiline popups in GridCtrl
By: unodgs on Mon, 09 November 2009 18:09
|
 |
|
Re: Multiline popups in GridCtrl
By: Zbych on Thu, 19 November 2009 15:31
|
 |
|
Re: Multiline popups in GridCtrl
By: Zbych on Fri, 20 November 2009 15:59
|
 |
|
Re: Multiline popups in GridCtrl
By: unodgs on Tue, 24 November 2009 13:29
|
 |
|
Re: Multiline popups in GridCtrl
By: Zbych on Mon, 30 November 2009 09:34
|
 |
|
Re: Multiline popups in GridCtrl
By: unodgs on Mon, 30 November 2009 10:11
|
Goto Forum:
Current Time: Wed Aug 27 08:27:09 CEST 2025
Total time taken to generate the page: 0.09800 seconds
|