Преглед изворни кода

UI checkbox control fix and more IDE stuff

Ivan Safrin пре 14 година
родитељ
комит
4a0226f768

+ 14 - 8
IDE/Build/Mac OS X/Polycode.xcodeproj/project.pbxproj

@@ -9,6 +9,9 @@
 /* Begin PBXBuildFile section */
 		1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
 		256AC3DA0F4B6AC300CF3369 /* PolycodeAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* PolycodeAppDelegate.m */; };
+		6D06CCF314BC203800E4CB4C /* libPolycore_d.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D06CCF214BC203800E4CB4C /* libPolycore_d.a */; };
+		6D06CCF514BC204200E4CB4C /* libPolycodeUI_d.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D06CCF414BC204200E4CB4C /* libPolycodeUI_d.a */; };
+		6D2AC99B14B8500400BB63DA /* PolycodeProjectEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D2AC99A14B8500400BB63DA /* PolycodeProjectEditor.cpp */; };
 		6D34143412B816BC0034FA9B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D34143312B816BC0034FA9B /* IOKit.framework */; };
 		6D3B6C5B14B820A900727F17 /* ToolWindows.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D3B6C5A14B820A900727F17 /* ToolWindows.cpp */; };
 		6D6D3FA614B446A600219173 /* PolycodeToolLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D6D3FA514B446A600219173 /* PolycodeToolLauncher.cpp */; };
@@ -19,7 +22,6 @@
 		6D80E92112AB53FB0037A708 /* PolycodeProjectBrowser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80E91C12AB53FB0037A708 /* PolycodeProjectBrowser.cpp */; };
 		6D80E92212AB53FB0037A708 /* PolycodeProjectManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80E91D12AB53FB0037A708 /* PolycodeProjectManager.cpp */; };
 		6D80EB1612AB7C6D0037A708 /* NewProjectWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80EB1512AB7C6D0037A708 /* NewProjectWindow.cpp */; };
-		6D8A55B214B3EA6C005F6411 /* libPolycore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D8A55B114B3EA6C005F6411 /* libPolycore.a */; };
 		6D8A55B914B3EABB005F6411 /* main_icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 6D8A55B814B3EABB005F6411 /* main_icon.icns */; };
 		6D8A55BC14B3EACB005F6411 /* PolycodeView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6D8A55BB14B3EACB005F6411 /* PolycodeView.mm */; };
 		6D91B3B512AF2B1D00261ED4 /* PolycodeTextEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D91B3B412AF2B1D00261ED4 /* PolycodeTextEditor.cpp */; };
@@ -37,7 +39,6 @@
 		6DFE89C114B3FC0900DA7ABD /* libphysfs.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DFE89BA14B3FC0900DA7ABD /* libphysfs.a */; };
 		6DFE89C214B3FC0900DA7ABD /* libpng15.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DFE89BB14B3FC0900DA7ABD /* libpng15.a */; };
 		6DFE89C314B3FC0900DA7ABD /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DFE89BC14B3FC0900DA7ABD /* libz.a */; };
-		6DFE89C514B3FC1700DA7ABD /* libPolycodeUI.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DFE89C414B3FC1700DA7ABD /* libPolycodeUI.a */; };
 		6DFE89CC14B3FE3D00DA7ABD /* default.pak in Resources */ = {isa = PBXBuildFile; fileRef = 6DFE89CB14B3FE3D00DA7ABD /* default.pak */; };
 		8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
 		8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
@@ -67,6 +68,10 @@
 		29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
 		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
 		29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+		6D06CCF214BC203800E4CB4C /* libPolycore_d.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPolycore_d.a; path = ../../../Release/Darwin/Framework/Core/lib/libPolycore_d.a; sourceTree = "<group>"; };
+		6D06CCF414BC204200E4CB4C /* libPolycodeUI_d.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPolycodeUI_d.a; path = ../../../Release/Darwin/Framework/Modules/lib/libPolycodeUI_d.a; sourceTree = "<group>"; };
+		6D2AC99A14B8500400BB63DA /* PolycodeProjectEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolycodeProjectEditor.cpp; sourceTree = "<group>"; };
+		6D2AC99D14B8500A00BB63DA /* PolycodeProjectEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeProjectEditor.h; sourceTree = "<group>"; };
 		6D34143312B816BC0034FA9B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
 		6D3B6C5A14B820A900727F17 /* ToolWindows.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ToolWindows.cpp; sourceTree = "<group>"; };
 		6D3B6C5C14B820B000727F17 /* ToolWindows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToolWindows.h; sourceTree = "<group>"; };
@@ -87,7 +92,6 @@
 		6D80EB1512AB7C6D0037A708 /* NewProjectWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewProjectWindow.cpp; sourceTree = "<group>"; };
 		6D80EB1712AB7C740037A708 /* NewProjectWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewProjectWindow.h; sourceTree = "<group>"; };
 		6D80EBAC12AB852B0037A708 /* PolycodeGlobals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeGlobals.h; sourceTree = "<group>"; };
-		6D8A55B114B3EA6C005F6411 /* libPolycore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPolycore.a; path = ../../../Release/Darwin/Framework/Core/lib/libPolycore.a; sourceTree = "<group>"; };
 		6D8A55B814B3EABB005F6411 /* main_icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = main_icon.icns; path = ../../../Assets/Icons/main_icon.icns; sourceTree = "<group>"; };
 		6D8A55BA14B3EACB005F6411 /* PolycodeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolycodeView.h; path = ../../../Release/Darwin/Framework/Core/PolycodeView/PolycodeView.h; sourceTree = "<group>"; };
 		6D8A55BB14B3EACB005F6411 /* PolycodeView.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = PolycodeView.mm; path = ../../../Release/Darwin/Framework/Core/PolycodeView/PolycodeView.mm; sourceTree = "<group>"; };
@@ -112,7 +116,6 @@
 		6DFE89BA14B3FC0900DA7ABD /* libphysfs.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libphysfs.a; path = ../../../Release/Darwin/Framework/Core/Dependencies/lib/libphysfs.a; sourceTree = "<group>"; };
 		6DFE89BB14B3FC0900DA7ABD /* libpng15.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng15.a; path = ../../../Release/Darwin/Framework/Core/Dependencies/lib/libpng15.a; sourceTree = "<group>"; };
 		6DFE89BC14B3FC0900DA7ABD /* libz.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libz.a; path = ../../../Release/Darwin/Framework/Core/Dependencies/lib/libz.a; sourceTree = "<group>"; };
-		6DFE89C414B3FC1700DA7ABD /* libPolycodeUI.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPolycodeUI.a; path = ../../../Release/Darwin/Framework/Modules/lib/libPolycodeUI.a; sourceTree = "<group>"; };
 		6DFE89CB14B3FE3D00DA7ABD /* default.pak */ = {isa = PBXFileReference; lastKnownFileType = file; name = default.pak; path = ../../../Release/Darwin/Framework/Core/Assets/default.pak; sourceTree = "<group>"; };
 		8D1107310486CEB800E47090 /* Polycode-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Polycode-Info.plist"; sourceTree = "<group>"; };
 		8D1107320486CEB800E47090 /* Polycode.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Polycode.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -127,7 +130,6 @@
 				6DFBF64A12A3758400C43A7D /* OpenAL.framework in Frameworks */,
 				6DFBF64B12A3758400C43A7D /* OpenGL.framework in Frameworks */,
 				6D34143412B816BC0034FA9B /* IOKit.framework in Frameworks */,
-				6D8A55B214B3EA6C005F6411 /* libPolycore.a in Frameworks */,
 				6DFE89BD14B3FC0900DA7ABD /* libfreetype.a in Frameworks */,
 				6DFE89BE14B3FC0900DA7ABD /* liblibogg.a in Frameworks */,
 				6DFE89BF14B3FC0900DA7ABD /* liblibvorbis.a in Frameworks */,
@@ -135,7 +137,8 @@
 				6DFE89C114B3FC0900DA7ABD /* libphysfs.a in Frameworks */,
 				6DFE89C214B3FC0900DA7ABD /* libpng15.a in Frameworks */,
 				6DFE89C314B3FC0900DA7ABD /* libz.a in Frameworks */,
-				6DFE89C514B3FC1700DA7ABD /* libPolycodeUI.a in Frameworks */,
+				6D06CCF314BC203800E4CB4C /* libPolycore_d.a in Frameworks */,
+				6D06CCF514BC204200E4CB4C /* libPolycodeUI_d.a in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -154,7 +157,8 @@
 		1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
 			isa = PBXGroup;
 			children = (
-				6DFE89C414B3FC1700DA7ABD /* libPolycodeUI.a */,
+				6D06CCF414BC204200E4CB4C /* libPolycodeUI_d.a */,
+				6D06CCF214BC203800E4CB4C /* libPolycore_d.a */,
 				6DFE89B614B3FC0900DA7ABD /* libfreetype.a */,
 				6DFE89B714B3FC0900DA7ABD /* liblibogg.a */,
 				6DFE89B814B3FC0900DA7ABD /* liblibvorbis.a */,
@@ -162,7 +166,6 @@
 				6DFE89BA14B3FC0900DA7ABD /* libphysfs.a */,
 				6DFE89BB14B3FC0900DA7ABD /* libpng15.a */,
 				6DFE89BC14B3FC0900DA7ABD /* libz.a */,
-				6D8A55B114B3EA6C005F6411 /* libPolycore.a */,
 				6D34143312B816BC0034FA9B /* IOKit.framework */,
 				6DFBF64812A3758400C43A7D /* OpenAL.framework */,
 				6DFBF64912A3758400C43A7D /* OpenGL.framework */,
@@ -238,6 +241,7 @@
 		6D80E91212AB53FB0037A708 /* Include */ = {
 			isa = PBXGroup;
 			children = (
+				6D2AC99D14B8500A00BB63DA /* PolycodeProjectEditor.h */,
 				6D3B6C5C14B820B000727F17 /* ToolWindows.h */,
 				6DCAFD4614B51A2D00039F34 /* ExampleBrowserWindow.h */,
 				6D6D3FA814B446AF00219173 /* PolycodeToolLauncher.h */,
@@ -262,6 +266,7 @@
 		6D80E91812AB53FB0037A708 /* Source */ = {
 			isa = PBXGroup;
 			children = (
+				6D2AC99A14B8500400BB63DA /* PolycodeProjectEditor.cpp */,
 				6D3B6C5A14B820A900727F17 /* ToolWindows.cpp */,
 				6DCAFD4214B519C900039F34 /* ExampleBrowserWindow.cpp */,
 				6D6D3FA514B446A600219173 /* PolycodeToolLauncher.cpp */,
@@ -382,6 +387,7 @@
 				6D6D3FA614B446A600219173 /* PolycodeToolLauncher.cpp in Sources */,
 				6DCAFD4314B519C900039F34 /* ExampleBrowserWindow.cpp in Sources */,
 				6D3B6C5B14B820A900727F17 /* ToolWindows.cpp in Sources */,
+				6D2AC99B14B8500400BB63DA /* PolycodeProjectEditor.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 1 - 0
IDE/Contents/Include/PolycodeIDEApp.h

@@ -33,6 +33,7 @@
 #include "PolycodeImageEditor.h"
 #include "PolycodeFontEditor.h"
 #include "PolycodeTextEditor.h"
+#include "PolycodeProjectEditor.h"
 
 #include "PolycodeToolLauncher.h"
 

+ 56 - 0
IDE/Contents/Include/PolycodeProjectEditor.h

@@ -0,0 +1,56 @@
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
+#pragma once
+
+#include "PolycodeGlobals.h"
+#include "PolycodeUI.h"
+#include "PolycodeEditor.h"
+#include <Polycode.h>
+
+using namespace Polycode;
+
+class PolycodeProjectEditor : public PolycodeEditor {
+	public:
+	PolycodeProjectEditor();
+	virtual ~PolycodeProjectEditor();
+	
+	bool openFile(String filePath);
+	void Resize(int x, int y);
+	void saveFile();
+	
+	protected:
+	
+	UICheckBox *vSyncCheckBox;
+	UIWindow *mainSettingsWindow;	
+	UITextInput *defaultWidthInput;
+	UITextInput *defaultHeightInput;	
+	//UIHSlider *aaLevelInput;	
+//	UIComboBox *aaLevelComboBox;
+	UITextInput *entryPointInput;	
+};
+
+class PolycodeProjectEditorFactory : public PolycodeEditorFactory {
+	public:
+		PolycodeProjectEditorFactory() : PolycodeEditorFactory() { extensions.push_back("polyproject"); }
+		PolycodeEditor *createEditor() { return new PolycodeProjectEditor(); }
+};

+ 1 - 1
IDE/Contents/Include/PolycodeTextEditor.h

@@ -35,7 +35,7 @@ public:
 	
 	bool openFile(String filePath);
 	void Resize(int x, int y);
-	void saveFile();	
+	void saveFile();
 	
 protected:
 

BIN
IDE/Contents/Resources/UIThemes/default/checkbox_checked.png


BIN
IDE/Contents/Resources/UIThemes/default/checkbox_unchecked.png


+ 11 - 10
IDE/Contents/Resources/UIThemes/default/theme.xml

@@ -31,11 +31,9 @@
 	<uiTreeContainerSkinB>2</uiTreeContainerSkinB>
 	<uiTreeContainerSkinL>2</uiTreeContainerSkinL>
 	
-	<uiScrollDefaultSize>19</uiScrollDefaultSize>
-	
+	<uiScrollDefaultSize>19</uiScrollDefaultSize>	
 	<uiScrollPanePadding>0</uiScrollPanePadding>
 
-
 	<uiButtonSkin>button.png</uiButtonSkin>
 	<uiButtonFocusedSkin>buttonFocused.png</uiButtonFocusedSkin>
 	<uiButtonFontSize>11</uiButtonFontSize>	
@@ -44,14 +42,12 @@
 	<uiButtonSkinB>4</uiButtonSkinB>
 	<uiButtonSkinL>4</uiButtonSkinL>
 
-
 	<uiWindowSkin>windowBg.png</uiWindowSkin>
 	<uiWindowSkinT>29</uiWindowSkinT>
 	<uiWindowSkinR>3</uiWindowSkinR>
 	<uiWindowSkinB>3</uiWindowSkinB>
 	<uiWindowSkinL>3</uiWindowSkinL>
-	<uiWindowSkinPadding>10</uiWindowSkinPadding>
-		
+	<uiWindowSkinPadding>10</uiWindowSkinPadding>		
 	<uiWindowTitleFont>sans</uiWindowTitleFont>
 	<uiWindowTitleFontSize>12</uiWindowTitleFontSize>
 	<uiWindowTitleX>5</uiWindowTitleX>	
@@ -60,7 +56,6 @@
 	<uiCloseIconX>6</uiCloseIconX>	
 	<uiCloseIconY>7</uiCloseIconY>		
 
-	
 	<uiScrollBgSkin>scrollBg.png</uiScrollBgSkin>
 	<uiScrollBgSkinPadding>2</uiScrollBgSkinPadding>
 	<uiScrollBgSkinT>2</uiScrollBgSkinT>
@@ -81,8 +76,14 @@
 	<textBgSkinL>3</textBgSkinL>
 	<textBgSkinPadding>5</textBgSkinPadding>
 	<textEditLineSpacing>4</textEditLineSpacing>
-	
-	<uiScrollHandleMinSize>30</uiScrollHandleMinSize>
-	
+		
+	<uiScrollHandleMinSize>30</uiScrollHandleMinSize>	
 	<uiTreeContainerScrollBarOffset>27</uiTreeContainerScrollBarOffset>
+	
+	<uiCheckBoxFont>sans</uiCheckBoxFont>
+	<uiCheckBoxFontSize>11</uiCheckBoxFontSize>	
+	<uiCheckBoxCheckedImage>checkbox_checked.png</uiCheckBoxCheckedImage>
+	<uiCheckBoxUncheckedImage>checkbox_unchecked.png</uiCheckBoxUncheckedImage>
+	<uiCheckBoxLabelOffsetX>10</uiCheckBoxLabelOffsetX>
+	<uiCheckBoxLabelOffsetY>3</uiCheckBoxLabelOffsetY>
 </PolyConfig>

+ 2 - 1
IDE/Contents/Source/PolycodeIDEApp.cpp

@@ -50,7 +50,8 @@ PolycodeIDEApp::PolycodeIDEApp(PolycodeView *view) : EventDispatcher() {
 	editorManager->registerEditorFactory(new PolycodeImageEditorFactory());
 	editorManager->registerEditorFactory(new PolycodeFontEditorFactory());
 	editorManager->registerEditorFactory(new PolycodeTextEditorFactory());
-	
+	editorManager->registerEditorFactory(new PolycodeProjectEditorFactory());
+		
 	frame = new PolycodeFrame();
 	frame->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
 

+ 101 - 0
IDE/Contents/Source/PolycodeProjectEditor.cpp

@@ -0,0 +1,101 @@
+/*
+ Copyright (C) 2012 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
+#include "PolycodeProjectEditor.h"
+
+PolycodeProjectEditor::PolycodeProjectEditor() : PolycodeEditor(true){
+	mainSettingsWindow = new UIWindow("Project Settings", 300, 500);
+	mainSettingsWindow->setPosition(10,10);
+	addChild(mainSettingsWindow);
+	
+	Config *conf = CoreServices::getInstance()->getConfig();	
+	String fontName = conf->getStringValue("Polycode", "uiDefaultFontName");
+	int fontSize = conf->getNumericValue("Polycode", "uiDefaultFontSize");	
+	Number padding = conf->getNumericValue("Polycode", "uiWindowSkinPadding");	
+		
+	ScreenLabel *label2 = new ScreenLabel(L"Width:", fontSize, fontName, Label::ANTIALIAS_FULL);
+	mainSettingsWindow->addChild(label2);
+	label2->setPosition(padding, 50);		
+	
+	defaultWidthInput = new UITextInput(false, 60, 12);	
+	mainSettingsWindow->addChild(defaultWidthInput);
+	defaultWidthInput->setPosition(label2->getPosition().x, label2->getPosition().y+label2->getHeight());
+	
+
+	label2 = new ScreenLabel(L"Height:", fontSize, fontName, Label::ANTIALIAS_FULL);
+	mainSettingsWindow->addChild(label2);
+	label2->setPosition(padding + 80, 50);		
+	
+	defaultHeightInput = new UITextInput(false, 60, 12);	
+	mainSettingsWindow->addChild(defaultHeightInput);
+	defaultHeightInput->setPosition(label2->getPosition().x, label2->getPosition().y+label2->getHeight());
+
+	
+	label2 = new ScreenLabel(L"Anti-aliasing:", fontSize, fontName, Label::ANTIALIAS_FULL);
+	mainSettingsWindow->addChild(label2);
+	label2->setPosition(padding + 160, 50);		
+	
+/*
+	aaLevelComboBox = new UIComboBox(100);		
+	mainSettingsWindow->addChild(aaLevelComboBox);	
+	aaLevelComboBox->addComboItem("No AA");
+	aaLevelComboBox->addComboItem("2x MSAA");
+	aaLevelComboBox->addComboItem("4x MSAA");
+	aaLevelComboBox->addComboItem("6x MSAA");			
+	aaLevelComboBox->setPosition(label2->getPosition().x, label2->getPosition().y+label2->getHeight());
+*/
+	
+//	aaLevelInput = new UIHSlider(0,6, 100);
+//	mainSettingsWindow->addChild(aaLevelInput);
+//	aaLevelInput->setPosition(label2->getPosition().x, label2->getPosition().y+label2->getHeight());
+
+
+	vSyncCheckBox = new UICheckBox("V-Sync", false);
+	vSyncCheckBox->setPosition(padding, defaultHeightInput->getPosition().y+defaultHeightInput->getHeight()+10);
+	mainSettingsWindow->addChild(vSyncCheckBox);
+	
+	label2 = new ScreenLabel(L"Entry point file:", fontSize, fontName, Label::ANTIALIAS_FULL);
+	mainSettingsWindow->addChild(label2);
+	label2->setPosition(padding, vSyncCheckBox->getPosition().y+vSyncCheckBox->getHeight()+10);		
+	
+	entryPointInput = new UITextInput(false, 200, 12);	
+	mainSettingsWindow->addChild(entryPointInput);
+	entryPointInput->setPosition(label2->getPosition().x, label2->getPosition().y+label2->getHeight());
+	
+	
+}
+
+PolycodeProjectEditor::~PolycodeProjectEditor() {
+	
+}
+
+bool PolycodeProjectEditor::openFile(String filePath) {
+	PolycodeEditor::openFile(filePath);
+	return true;
+}
+
+void PolycodeProjectEditor::Resize(int x, int y) {
+}
+
+void PolycodeProjectEditor::saveFile() {
+
+}

+ 0 - 1
IDE/Contents/Source/PolycodeTextEditor.cpp

@@ -23,7 +23,6 @@
 #include "PolycodeTextEditor.h"
 
 PolycodeTextEditor::PolycodeTextEditor() : PolycodeEditor(true){
-
 }
 
 PolycodeTextEditor::~PolycodeTextEditor() {

+ 3 - 3
Modules/Contents/UI/Include/PolyUICheckBox.h

@@ -33,7 +33,7 @@ namespace Polycode {
 
 	class _PolyExport UICheckBox : public ScreenEntity {
 		public:
-			UICheckBox(Font *font, String checkImage, String caption, bool checked);
+			UICheckBox(String caption, bool checked);
 			~UICheckBox();
 		
 			void changeCheck();
@@ -43,9 +43,9 @@ namespace Polycode {
 		private:
 			bool checked;
 			ScreenLabel *captionLabel;
-			ScreenShape *buttonRect;
 			ScreenShape *shadowRect;
-			ScreenImage *buttonImage;
+			ScreenImage *buttonImageChecked;
+			ScreenImage *buttonImageUnchecked;			
 			bool pressedDown;
 	};
 }

+ 1 - 1
Modules/Contents/UI/Include/PolyUIHSlider.h

@@ -33,7 +33,7 @@ namespace Polycode {
 
 	class _PolyExport UIHSlider : public ScreenEntity {
 		public:
-			UIHSlider(Font *font, Number start, Number end, Number width);
+			UIHSlider(Number start, Number end, Number width);
 			~UIHSlider();		
 			void handleEvent(Event *event);
 			void Update();

+ 33 - 18
Modules/Contents/UI/Source/PolyUICheckBox.cpp

@@ -23,32 +23,46 @@
 #include "PolyUICheckBox.h"
 #include "PolyInputEvent.h"
 #include "PolyLabel.h"
+#include "PolyCoreServices.h"
+#include "PolyConfig.h"
 
 using namespace Polycode;
 
-UICheckBox::UICheckBox(Font *font, String checkImage, String caption, bool checked) : ScreenEntity() {
-	buttonImage = new ScreenImage(checkImage.c_str());
-	buttonImage->setPosition(2, 3);
+UICheckBox::UICheckBox(String caption, bool checked) : ScreenEntity() {
+
+	Config *conf = CoreServices::getInstance()->getConfig();	
+	
+	String fontName = conf->getStringValue("Polycode", "uiCheckBoxFont");
+	int fontSize = conf->getNumericValue("Polycode", "uiCheckBoxFontSize");	
+	String checkImage = conf->getStringValue("Polycode", "uiCheckBoxCheckedImage");
+	String uncheckImage = conf->getStringValue("Polycode", "uiCheckBoxUncheckedImage");
+	Number checkboxTextOffsetX = conf->getNumericValue("Polycode", "uiCheckBoxLabelOffsetX");
+	Number checkboxTextOffsetY = conf->getNumericValue("Polycode", "uiCheckBoxLabelOffsetY");
+		
 	this->checked = checked;
-	buttonImage->visible = checked;
+		
+	buttonImageChecked = new ScreenImage(checkImage);
+	buttonImageChecked->visible = checked;
+
+	buttonImageUnchecked = new ScreenImage(uncheckImage);
+	buttonImageUnchecked->visible = !checked;
 	
-	captionLabel = new ScreenLabel(caption, 11, "", Label::ANTIALIAS_FULL);
+	captionLabel = new ScreenLabel(caption, fontSize, fontName, Label::ANTIALIAS_FULL);
 	addChild(captionLabel);
-	captionLabel->setPosition(buttonImage->getWidth()+14,0);
+	captionLabel->setPosition(buttonImageChecked->getWidth() + checkboxTextOffsetX, (buttonImageChecked->getHeight()/2.0) - (captionLabel->getHeight()/2.0) + checkboxTextOffsetY);
 	
-	buttonRect = new ScreenShape(ScreenShape::SHAPE_RECT, buttonImage->getWidth()+5,buttonImage->getHeight()+5,0,0);
-	buttonRect->setColor(0.1f, 0.1f, 0.1f, 1.0f);
-	buttonRect->strokeEnabled = true;
-	buttonRect->setStrokeColor(1.0f, 1.0f, 1.0f, 0.1f);
-	addChild(buttonRect);
-	addChild(buttonImage);
+	addChild(buttonImageUnchecked);	
+	addChild(buttonImageChecked);
 	
-	buttonRect->addEventListener(this, InputEvent::EVENT_MOUSEOVER);
-	buttonRect->addEventListener(this, InputEvent::EVENT_MOUSEOUT);
-	buttonRect->addEventListener(this, InputEvent::EVENT_MOUSEUP);
-	buttonRect->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
+	buttonImageUnchecked->addEventListener(this, InputEvent::EVENT_MOUSEOVER);
+	buttonImageUnchecked->addEventListener(this, InputEvent::EVENT_MOUSEOUT);
+	buttonImageUnchecked->addEventListener(this, InputEvent::EVENT_MOUSEUP);
+	buttonImageUnchecked->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
 	captionLabel->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
 	
+	height = buttonImageUnchecked->getHeight();
+	width = buttonImageUnchecked->getWidth() + captionLabel->getWidth() + checkboxTextOffsetX;
+	
 }
 
 UICheckBox::~UICheckBox() {
@@ -61,12 +75,13 @@ bool UICheckBox::isChecked() {
 		
 void UICheckBox::changeCheck() {
 	checked = !checked;
-	buttonImage->visible = checked;
+	buttonImageChecked->visible = checked;
+	buttonImageUnchecked->visible = !checked;
 	dispatchEvent(new UIEvent(), UIEvent::CHANGE_EVENT);	
 }
 		
 void UICheckBox::handleEvent(Event *event) {
-	if(event->getDispatcher() == buttonRect || event->getDispatcher() == captionLabel) {
+	if(event->getDispatcher() == buttonImageUnchecked || event->getDispatcher() == captionLabel) {
 		switch(event->getEventCode()) {
 			case InputEvent::EVENT_MOUSEDOWN:
 				changeCheck();

+ 1 - 1
Modules/Contents/UI/Source/PolyUIHSlider.cpp

@@ -25,7 +25,7 @@
 
 using namespace Polycode;
 
-UIHSlider::UIHSlider(Font *font, Number start, Number end, Number width) {
+UIHSlider::UIHSlider(Number start, Number end, Number width) {
 	bgRect = new ScreenShape(ScreenShape::SHAPE_RECT, width,8,0,0);
 	bgRect->setPosition(0,6);
 	bgRect->setColor(0.11f, 0.11f, 0.11f, 1.0f);