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 » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » GridCtrl questions
GridCtrl questions [message #31744] Wed, 23 March 2011 13:16 Go to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Daniel

A couple of questions about GridCtrl:

- Calling SetToolBar() does not show toolbar automatically until a grid row is selected.
Is there any way to force toolbar to be shown?

- When a row is selected and a Del key or minus button is pushed, is there any Callback that could be called and would confirm or not if row has to be definitively deleted?


Best regards
Iñaki
Re: GridCtrl questions [message #31768 is a reply to message #31744] Fri, 25 March 2011 20:31 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Hi Koldo! SetToolBar is used when GridCtrl refresh toolbar.

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}

[Updated on: Fri, 25 March 2011 20:32]

Report message to a moderator

Re: GridCtrl questions [message #31775 is a reply to message #31768] Sat, 26 March 2011 01:02 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
sergeynikitin wrote on Fri, 25 March 2011 20:31

Hi Koldo! SetToolBar is used when GridCtrl refresh toolbar.

Hello Sergey

If I put in a button callback SetToolBar() the tool bar does not appear.

Adding to the callback any call to UpdateXXX() or RefreshXXX() functions, it is the same.

The button does appear just when clicking the grid.


Best regards
Iñaki
Re: GridCtrl questions [message #31822 is a reply to message #31775] Wed, 30 March 2011 02:24 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

1-st in header of TopWindow-class

ToolButton allShipments;
void TEST() {PromptOK("TEST WINDOWS");}
void ShipmentsToolBar(Bar& bar);


2-nd - after initialization (usialy in window constructor)

listbox.SetToolBar();
listbox.WhenToolBar = THISBACK(ShipmentsToolBar);

allShipments.Image(Icons::AllShipments());
allShipments.Label(t_("All shipments"));
allShipments.Text(t_("All Shipments"));
allShipments.Tip(t_("Show All Shipments in single window"));
allShipments.WhenAction = THISBACK(TEST);


3-d - Function to adding additional ToolButton:

void ProjectEditDlg::ShipmentsToolBar(Bar& bar){
    listbox.StdToolBar(bar);
    bar.Separator();
    bar.Add(allShipments);
} 


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}

[Updated on: Wed, 30 March 2011 02:31]

Report message to a moderator

Re: GridCtrl questions [message #31824 is a reply to message #31775] Wed, 30 March 2011 07:46 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Toolbar (not only in GridCtrl) is visible only if it contains something. Empty toolbar is drawn as a thin line. In GridCtrl you have to activate functions like appending, deleting etc. Try this code for example
grid.Appending().Searching();
grid.SetToolBar();

Re: GridCtrl questions [message #31825 is a reply to message #31744] Wed, 30 March 2011 07:51 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Quote:


- When a row is selected and a Del key or minus button is pushed, is there any Callback that could be called and would confirm or not if row has to be definitively deleted?


Yes, there is Smile WhenRemovedRow (don't confuse with WhenRemoveRow)
Re: GridCtrl questions [message #31841 is a reply to message #31825] Wed, 30 March 2011 18:17 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Daniel and all

Thank you for your answers.

About Toolbar, the trick is in function RebuildToolBar(). So, the code in callback could be:

grid.Appending(visible).Duplicating(visible).Removing(visible);
grid.RebuildToolBar();


About WhenRemovedRow()... it does not serve as it is a Callback and should be a Gate, I mean, if user clicks Del to remove a row, it would be called to validate or not the deletion so it would have to return some bool.

Any ideas? Smile


Best regards
Iñaki
Previous Topic: Newbie question: ArrayCtrl::IsModified(int ii) not work at expected.
Next Topic: DropGrid improvement proposals
Goto Forum:
  


Current Time: Thu Mar 28 14:15:04 CET 2024

Total time taken to generate the page: 0.01110 seconds