Home » U++ TheIDE » U++ TheIDE: CodeEditor, Assist++, Topic++ » QTF editor feature request + patch
QTF editor feature request + patch [message #27155] |
Mon, 28 June 2010 22:30  |
|
Hello Mirek,
When creating some app, I often change my mind about what should the widgets, dialogues etc. say to the user. The QTF is a great tool to write good looking messages, but it could be even better 
Now, if you want to edit already existing text, you have to: copy it, press alt+Q, paste it, do the editing, close the dialog and replace previous text with the new one from clipboard.
I think it would make sense to shorten this to: select text, press Alt+Q, do the editing, close dialog. That is cutting two unnecessary key strokes 
The code would be something like:void Ide::Qtf()
{
QtfDlg dlg;
LoadFromGlobal(dlg, "QTF-designer");
int l,h;
bool sel=editor.GetSelection(l,h);
if(sel){
dlg.text<<=(~editor).ToString().Mid(l,h-l);
dlg.copy.SetLabel("Apply and close");
}
dlg.Run();
if(sel){
editor.Remove(l,h-l);
editor.Insert(l,(~dlg.text).ToString());
}
StoreToGlobal(dlg, "QTF-designer");
}
What do you think about it?
Best regards,
Honza
|
|
|
Re: QTF editor feature request + patch [message #28597 is a reply to message #27155] |
Wed, 08 September 2010 09:47   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
dolik.rce wrote on Mon, 28 June 2010 16:30 | Hello Mirek,
When creating some app, I often change my mind about what should the widgets, dialogues etc. say to the user. The QTF is a great tool to write good looking messages, but it could be even better 
Now, if you want to edit already existing text, you have to: copy it, press alt+Q, paste it, do the editing, close the dialog and replace previous text with the new one from clipboard.
I think it would make sense to shorten this to: select text, press Alt+Q, do the editing, close dialog. That is cutting two unnecessary key strokes 
The code would be something like:void Ide::Qtf()
{
QtfDlg dlg;
LoadFromGlobal(dlg, "QTF-designer");
int l,h;
bool sel=editor.GetSelection(l,h);
if(sel){
dlg.text<<=(~editor).ToString().Mid(l,h-l);
dlg.copy.SetLabel("Apply and close");
}
dlg.Run();
if(sel){
editor.Remove(l,h-l);
editor.Insert(l,(~dlg.text).ToString());
}
StoreToGlobal(dlg, "QTF-designer");
}
What do you think about it?
Best regards,
Honza
|
OK, but to be conservative, I would like to have an option (in setup/Environment) that enables it - which would be ON by default.
|
|
|
Re: QTF editor feature request + patch [message #28635 is a reply to message #28597] |
Wed, 08 September 2010 17:46  |
|
luzr wrote on Wed, 08 September 2010 09:47 | OK, but to be conservative, I would like to have an option (in setup/Environment) that enables it - which would be ON by default.
|
As you wish Just committed.
This is my first "visible" change to theide, I hope I didn't mess up anything 
Honza
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:16:01 CEST 2025
Total time taken to generate the page: 0.00583 seconds
|