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 » LineEdit, EditFields, DocEdit » How applying syntax, for example c++?
How applying syntax, for example c++? [message #48781] Sun, 17 September 2017 23:36 Go to next message
AndrzejB is currently offline  AndrzejB
Messages: 2
Registered: September 2017
Junior Member
I am newbie in Ultimate++.
I am using CodeEditor class, No syntax highlighting and auto indent. How say CodeEditor that my syntax is c++ or other?
My first program:
#include <CtrlLib/CtrlLib.h>
#include <CodeEditor/CodeEditor.h>

using namespace Upp;

struct MyAppWindow : TopWindow {
	Button button;
	CodeEditor ed;

	void Click() { PromptOK("You have clicked the button!"); }

	typedef MyAppWindow CLASSNAME;

	MyAppWindow() {
		Title("My application with button");
		Add(ed.LeftPos(10, 200).TopPos(10, 200));
		button.SetLabel("Click me!");
		button <<= THISBACK(Click);
	}
};

GUI_APP_MAIN
{
	MyAppWindow app;
	app.Run();
}
Re: How applying syntax, for example c++? [message #48784 is a reply to message #48781] Mon, 18 September 2017 11:56 Go to previous message
mirek is currently offline  mirek
Messages: 11994
Registered: November 2005
Ultimate Member
#include <CtrlLib/CtrlLib.h>
#include <CodeEditor/CodeEditor.h>

using namespace Upp;

struct MyAppWindow : TopWindow {
	Button button;
	CodeEditor ed;

	void Click() { PromptOK("You have clicked the button!"); }

	typedef MyAppWindow CLASSNAME;

	MyAppWindow() {
		Title("My application with button");
		Add(ed.LeftPos(10, 200).TopPos(10, 200));
		button.SetLabel("Click me!");
		button <<= THISBACK(Click);
		
		ed.Highlight("cpp");
	}
};

GUI_APP_MAIN
{
	MyAppWindow app;
	app.Run();
}
Previous Topic: an easy way for EditDoubleNotNull to use 0 as def?
Next Topic: LineEdit how to set selection from code
Goto Forum:
  


Current Time: Sun Aug 25 12:10:33 CEST 2019

Total time taken to generate the page: 0.01191 seconds