Home » U++ Library support » TreeCtrl » SetFocus with EditString as Node
Re: SetFocus with EditString as Node [message #40918 is a reply to message #40901] |
Mon, 07 October 2013 20:20 |
|
mirek
Messages: 13984 Registered: November 2005
|
Ultimate Member |
|
|
iST1 wrote on Sat, 05 October 2013 09:35 | This is simple edit node example (based on <a href=" http://www.ultimatepp.org/forum/index.php?t=msg&th=6380& amp; amp;start=0&" target="_blank"></a>) with SetFocus problem when first "Add" button click:
class EditableTree : public TreeCtrl {
public:
EditableTree() : selId_(-1) {
editNode.SetCtrl(edit);
OpenDeep(0, true);
}
void AddNode() {
CloseEdit();
int selId_ = Add(0);
edit.SetData("Node" + AsString(selId_));
edit.Show();
edit.AutoSize();
edit.SetFocus();//at first not select because IsOpen is false => why?
SetNode(selId_, editNode);
}
void CloseEdit() {
if (selId_ > 0) {
SetNode(selId_, Node(~edit));
edit.Hide();
}
}
private:
int selId_;
EditString edit;
TreeCtrl::Node editNode;
};
GUI_APP_MAIN
{
TopWindow wnd;
Button btn;
wnd.Add(btn.SetLabel("Add").LeftPos(10).TopPos(10));
EditableTree tree;
wnd.Add(tree.VSizePos(40).HSizePos());
btn <<= callback(&tree, &EditableTree::AddNode);
wnd.Run();
}
|
Should be fixed, however you have to use SetFocus AFTER SetNode,
because only widget that is descendant of open window can have focus and until SetNode, edit is not assigned to any window. However, TreeCtrl still needed fixing to make it work...
|
|
|
|
|
SetFocus with EditString as Node
By: iST1 on Sat, 05 October 2013 15:35
|
|
|
Re: SetFocus with EditString as Node
By: mirek on Mon, 07 October 2013 20:20
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Mon, 21 October 2013 18:40
|
|
|
Re: SetFocus with EditString as Node
By: mirek on Tue, 22 October 2013 19:34
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Wed, 23 October 2013 08:38
|
|
|
Re: SetFocus with EditString as Node
By: mirek on Wed, 23 October 2013 08:49
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Mon, 28 October 2013 17:58
|
|
|
Re: SetFocus with EditString as Node
By: mirek on Wed, 30 October 2013 09:46
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Thu, 31 October 2013 15:06
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Sun, 03 November 2013 08:20
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Sun, 03 November 2013 10:05
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Wed, 06 November 2013 16:36
|
|
|
Re: SetFocus with EditString as Node
By: mirek on Thu, 07 November 2013 10:33
|
|
|
Re: SetFocus with EditString as Node
By: mirek on Thu, 07 November 2013 15:58
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Thu, 07 November 2013 18:38
|
|
|
Re: SetFocus with EditString as Node
By: mirek on Fri, 08 November 2013 07:58
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Fri, 08 November 2013 11:14
|
|
|
Re: SetFocus with EditString as Node
By: mirek on Fri, 08 November 2013 11:26
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Fri, 08 November 2013 11:40
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Fri, 08 November 2013 17:46
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Sun, 10 November 2013 07:24
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Mon, 11 November 2013 09:34
|
|
|
Re: SetFocus with EditString as Node
By: mirek on Mon, 11 November 2013 15:46
|
|
|
Re: SetFocus with EditString as Node
By: iST1 on Mon, 11 November 2013 19:16
|
Goto Forum:
Current Time: Tue Jun 04 12:39:48 CEST 2024
Total time taken to generate the page: 0.01507 seconds
|