mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
Added CodeEditor project to be able to test comfortably the UICodeEditor and the TextDocument.
Renamed Window::setCaption to Window::setTitle. Several fixes in TextDocument.
This commit is contained in:
@@ -129,7 +129,7 @@ void demo1Create() {
|
||||
|
||||
createJointAndBody();
|
||||
|
||||
mWindow->setCaption( "eepp - Physics - Logo Smash" );
|
||||
mWindow->setTitle( "eepp - Physics - Logo Smash" );
|
||||
|
||||
mSpace = Physics::Space::New();
|
||||
mSpace->setIterations( 1 );
|
||||
@@ -184,7 +184,7 @@ void demo2Create() {
|
||||
|
||||
createJointAndBody();
|
||||
|
||||
mWindow->setCaption( "eepp - Physics - Pyramid Stack" );
|
||||
mWindow->setTitle( "eepp - Physics - Pyramid Stack" );
|
||||
|
||||
Shape::resetShapeIdCounter();
|
||||
|
||||
@@ -313,7 +313,7 @@ void demo3Create() {
|
||||
|
||||
createJointAndBody();
|
||||
|
||||
mWindow->setCaption( "eepp - Physics - Sensor" );
|
||||
mWindow->setTitle( "eepp - Physics - Sensor" );
|
||||
|
||||
Shape::resetShapeIdCounter();
|
||||
|
||||
@@ -478,7 +478,7 @@ void demo4Create() {
|
||||
|
||||
createJointAndBody();
|
||||
|
||||
mWindow->setCaption( "eepp - Physics - Sticky collisions using the Arbiter data pointer." );
|
||||
mWindow->setTitle( "eepp - Physics - Sticky collisions using the Arbiter data pointer." );
|
||||
|
||||
mSpace = Space::New();
|
||||
mSpace->setIterations( 10 );
|
||||
|
||||
@@ -30,21 +30,14 @@ void mainLoop() {
|
||||
}
|
||||
|
||||
EE_MAIN_FUNC int main( int, char** ) {
|
||||
Display* currentDisplay = Engine::instance()->getDisplayManager()->getDisplayIndex( 0 );
|
||||
Float pixelDensity = currentDisplay->getPixelDensity();
|
||||
|
||||
win = Engine::instance()->createWindow( WindowSettings( 1024, 768, "eepp - UI Hello World" ),
|
||||
win = Engine::instance()->createWindow( WindowSettings( 640, 480, "eepp - UI Hello World" ),
|
||||
ContextSettings( true ) );
|
||||
|
||||
if ( win->isOpen() ) {
|
||||
PixelDensity::setPixelDensity( eemax( win->getScale(), pixelDensity ) );
|
||||
|
||||
// Load a font to use as the default font in our UI.
|
||||
FontTrueType* font =
|
||||
FontTrueType::New( "NotoSans-Regular", "assets/fonts/NotoSans-Regular.ttf" );
|
||||
|
||||
FontTrueType::New( "monospace", "assets/fonts/DejaVuSansMono.ttf" );
|
||||
|
||||
// Create a new scene node to add our widgets.
|
||||
UISceneNode* uiSceneNode = UISceneNode::New();
|
||||
|
||||
@@ -68,11 +61,6 @@ EE_MAIN_FUNC int main( int, char** ) {
|
||||
layout_width="match_parent"
|
||||
layout_height="wrap_content"
|
||||
text="Hello, I am a PushButton" />
|
||||
<CodeEditor id="code_edit"
|
||||
layout_width="match_parent"
|
||||
layout_height="0dp"
|
||||
layout_weight="1"
|
||||
/>
|
||||
</LinearLayout>
|
||||
)xml";
|
||||
uiSceneNode->loadLayoutFromString( layout );
|
||||
@@ -95,16 +83,6 @@ EE_MAIN_FUNC int main( int, char** ) {
|
||||
}
|
||||
)css" );
|
||||
|
||||
UICodeEditor* codeEditor = uiSceneNode->find<UICodeEditor>( "code_edit" );
|
||||
codeEditor->setFontSize( 11 )
|
||||
//->loadFromFile( "../docs/articles/cssspecification.md" );
|
||||
//->loadFromFile( "assets/ui/breeze.css" );
|
||||
->loadFromFile( "assets/layouts/test_widgets.xml" );
|
||||
//->loadFromFile( "../src/eepp/ui/doc/textdocument.cpp" );
|
||||
//->loadFromFile( "../premake5.lua" );
|
||||
//->loadFromFile( "eepp-UIEditor-debug.js" );
|
||||
//->loadFromFile( "../docs/doxyrest/sphinx/doxyrest.py" );
|
||||
//->loadFromFile( "../projects/emscripten/make.sh" );
|
||||
win->runMainLoop( &mainLoop );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user