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++ » U++ Developers corner » What is the best: a separate UppCodeEditor or expanding the existing?
What is the best: a separate UppCodeEditor or expanding the existing? [message #2040] Thu, 30 March 2006 15:57 Go to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
I want to have my customized DialectCodeEditor, someone PythonCodeEditor etc. with connections to I guess different Assists. And, I guess, we all want different right click popup menus.

What would be the best for all interested sides:
1. a separate UppCodeEditor, PythonCodeEditor etc. by sublassing from CodeEditor or
2. expanding the existing interface?
3. other alternatives.

I've started the 1.option succesfully but I don't want to waste my time if later some new grand changes will emerge. Also, I want to know the best technical considerations.

[Updated on: Thu, 30 March 2006 15:57]

Report message to a moderator

Re: What is the best: a separate UppCodeEditor or expanding the existing? [message #2046 is a reply to message #2040] Thu, 30 March 2006 22:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Thu, 30 March 2006 08:57

I want to have my customized DialectCodeEditor, someone PythonCodeEditor etc. with connections to I guess different Assists. And, I guess, we all want different right click popup menus.

What would be the best for all interested sides:
1. a separate UppCodeEditor, PythonCodeEditor etc. by sublassing from CodeEditor or
2. expanding the existing interface?
3. other alternatives.

I've started the 1.option succesfully but I don't want to waste my time if later some new grand changes will emerge. Also, I want to know the best technical considerations.


Well, the most safe approach would be to base your efforts on LineEdit (CodeEditor is derived from it as well).

Personally, I would most likely used CodeEditor, mosty to get Find&Replace, and reimplemented highlighting section.

Mirek
Re: What is the best: a separate UppCodeEditor or expanding the existing? [message #2050 is a reply to message #2046] Thu, 30 March 2006 22:15 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
But where to insert the code for popup context menu?
I've made my DialectCodeEditor derived from CodeEditor with adjusted HighlightLine and extra menu items.

something like this:
class DEditor : public CodeEditor {

    virtual  void HighlightLine(int line, Vector<LineEdit::Highlight>& hl, int pos);
public:
	void     OnListMenu(Bar& bar);
	void ToolEditInsert(Bar& bar);
	void testInsert();

	typedef DEditor CLASSNAME;

	DEditor();
	~DEditor() {;}
};



It works quite nicely (I rewrote HighlightLine implementation)
Why do you think I should use LineEdit?
Re: What is the best: a separate UppCodeEditor or expanding the existing? [message #2052 is a reply to message #2050] Thu, 30 March 2006 22:20 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Thu, 30 March 2006 15:15

But where to insert the code for popup context menu?



LineEdit::WhenBar

Quote:


It works quite nicely (I rewrote HighlightLine implementation)
Why do you think I should use LineEdit?


Well, as part of CtrlLib, it has quite fixed interface.

However, in fact, I suggested that just as option. I believe that deriving CodeEditor is a way to go.

Mirek
Re: What is the best: a separate UppCodeEditor or expanding the existing? [message #2053 is a reply to message #2052] Thu, 30 March 2006 22:28 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
luzr wrote on Thu, 30 March 2006 21:20

fudadmin wrote on Thu, 30 March 2006 15:15

But where to insert the code for popup context menu?



LineEdit::WhenBar


Mirek


I know that! Smile It works for me. I even made dynamic menus. But I'am asking in which place of the uppsrc/ide files or classes you are going to make connections with existing Assist menu items like "Go to definition/declaration"? Are you going to change LineEdit?!

[Updated on: Thu, 30 March 2006 22:29]

Report message to a moderator

Re: What is the best: a separate UppCodeEditor or expanding the existing? [message #2054 is a reply to message #2053] Thu, 30 March 2006 22:32 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Thu, 30 March 2006 15:28

luzr wrote on Thu, 30 March 2006 21:20

fudadmin wrote on Thu, 30 March 2006 15:15

But where to insert the code for popup context menu?



LineEdit::WhenBar


Mirek


I know that! Smile It works for me. I even made dynamic menus. But I'am asking in which place of the uppsrc/ide files or classes you are going to make connections with existing Assist menu items like "Go to definition/declaration"? Are you going to change LineEdit?!




Not sure what the question is... If you are asking about how I plan to add assist++ items to CodeEditor (which indeed should happen), then LineEdit::WhenBar is a perfect way how to do that. And it will likely be in the "ide" package, not "CodeEditor"...

Mirek
Re: What is the best: a separate UppCodeEditor or expanding the existing? [message #2055 is a reply to message #2054] Thu, 30 March 2006 22:38 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
Quote:

Not sure what the question is... If you are asking about how I plan to add assist++ items to CodeEditor (which indeed should happen), then LineEdit::WhenBar is a perfect way how to do that. And it will likely be in the "ide" package, not "CodeEditor"...


Could you be more precise? I want to guess your logic of thinking and experiment. Smile
Re: What is the best: a separate UppCodeEditor or expanding the existing? [message #2057 is a reply to message #2055] Thu, 30 March 2006 22:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Thu, 30 March 2006 15:38

Quote:

Not sure what the question is... If you are asking about how I plan to add assist++ items to CodeEditor (which indeed should happen), then LineEdit::WhenBar is a perfect way how to do that. And it will likely be in the "ide" package, not "CodeEditor"...


Could you be more precise? I want to guess your logic of thinking and experiment. Smile


Ide::Ide
{
......
    editor.WhenBar = THISNACK(IdeEditorLocalMenu);
......
}


Is that what you have on mind? (I am not sure).

Mirek
Re: What is the best: a separate UppCodeEditor or expanding the existing? [message #2059 is a reply to message #2057] Fri, 31 March 2006 00:40 Go to previous message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
And then in idebar.cpp...
Quote:


void Ide::IdeEditorLocalMenu(Bar& menu)
{ //what items are needed put here?...
menu.Add(AK_JUMPS, THISBACK(JumpS));
menu.Add(AK_SWAPS, THISBACK(SwapS));
menu.Add(AK_JUMPS, THISBACK(JumpS));
menu.Separator();
editor.StdBar(menu);
//add extra item "customize menu..."
}


Thanks! ...Need to add some "if" logic here...

Edit: I mean, it works Smile

[Updated on: Fri, 31 March 2006 00:43]

Report message to a moderator

Previous Topic: Funny experiences with AlphaBlend....
Next Topic: Request for code audit
Goto Forum:
  


Current Time: Sat May 04 10:12:42 CEST 2024

Total time taken to generate the page: 0.03129 seconds