From 0bf0808f30055f2e212e66618a70902338f16df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Mon, 21 Jan 2013 02:44:07 -0300 Subject: [PATCH] Added a new default theme. --- include/eepp/gaming/cmap.hpp | 5 + include/eepp/system/filesystem.hpp | 3 + include/eepp/system/sys.hpp | 3 + include/eepp/ui.hpp | 4 +- include/eepp/ui/cuidefaulttheme.hpp | 35 ++++ projects/linux/ee.creator.user | 4 +- projects/linux/ee.files | 2 + src/eepp/gaming/cmap.cpp | 11 +- src/eepp/gaming/mapeditor/cmapeditor.cpp | 28 ++- src/eepp/gaming/mapeditor/cuimap.cpp | 3 + src/eepp/gaming/mapeditor/cuimapnew.cpp | 11 +- src/eepp/system/filesystem.cpp | 4 + src/eepp/system/sys.cpp | 34 ++++ src/eepp/ui/cuiaquatheme.cpp | 32 +-- src/eepp/ui/cuicommondialog.cpp | 36 ++-- src/eepp/ui/cuicomplexcontrol.cpp | 16 +- src/eepp/ui/cuidefaulttheme.cpp | 236 +++++++++++++++++++++++ src/eepp/ui/cuiprogressbar.cpp | 12 +- src/test/eetest.cpp | 29 ++- src/test/eetest.hpp | 2 +- 20 files changed, 440 insertions(+), 70 deletions(-) create mode 100644 include/eepp/ui/cuidefaulttheme.hpp create mode 100644 src/eepp/ui/cuidefaulttheme.cpp diff --git a/include/eepp/gaming/cmap.hpp b/include/eepp/gaming/cmap.hpp index 5e89d64af..af3aaf408 100644 --- a/include/eepp/gaming/cmap.hpp +++ b/include/eepp/gaming/cmap.hpp @@ -218,6 +218,10 @@ class EE_API cMap { void ForceHeadersOnLoad( eeSize mapSize, eeSize tileSize, Uint32 numLayers, Uint32 flags ); void DisableForcedHeaders(); + + void GridLinesColor( const eeColorA& Col ); + + const eeColorA& GridLinesColor() const; protected: class cForcedHeaders { @@ -266,6 +270,7 @@ class EE_API cMap { void * mData; eeColorA mTileOverColor; eeColorA mBackColor; + eeColorA mGridLinesColor; Uint8 mBackAlpha; bool mMouseOver; std::string mPath; diff --git a/include/eepp/system/filesystem.hpp b/include/eepp/system/filesystem.hpp index 8a3a4112b..f76116015 100644 --- a/include/eepp/system/filesystem.hpp +++ b/include/eepp/system/filesystem.hpp @@ -59,6 +59,9 @@ class EE_API FileSystem { /** Write a file in binary mode and close it. */ static bool FileWrite( const std::string& filepath, const std::vector& data ); + /** Deletes a file from the file system. */ + static bool FileRemove( const std::string& filepath ); + /** @return The modification date of the file */ static Uint32 FileGetModificationDate( const std::string& Filepath ); diff --git a/include/eepp/system/sys.hpp b/include/eepp/system/sys.hpp index 4d34d74d4..54b2aaa90 100644 --- a/include/eepp/system/sys.hpp +++ b/include/eepp/system/sys.hpp @@ -13,6 +13,9 @@ class EE_API Sys { /** @return A storage path for config files for every platform */ static std::string GetConfigPath( std::string appname ); + /** @return The path of the directory designated for temporary files. */ + static std::string GetTempPath(); + /** @return The number of milliseconds since the first call. Note that this value wraps if the program runs for more than ~49 days. */ static Uint32 GetTicks(); diff --git a/include/eepp/ui.hpp b/include/eepp/ui.hpp index 2fa6a8f4a..be7877bcf 100644 --- a/include/eepp/ui.hpp +++ b/include/eepp/ui.hpp @@ -45,7 +45,9 @@ #include #include #include -#include #include +#include +#include + #endif diff --git a/include/eepp/ui/cuidefaulttheme.hpp b/include/eepp/ui/cuidefaulttheme.hpp new file mode 100644 index 000000000..763525fad --- /dev/null +++ b/include/eepp/ui/cuidefaulttheme.hpp @@ -0,0 +1,35 @@ +#ifndef EE_UICUIDEFAULTTHEME_HPP +#define EE_UICUIDEFAULTTHEME_HPP + +#include + +namespace EE { namespace UI { + +class EE_API cUIDefaultTheme : public cUITheme { + public: + cUIDefaultTheme( const std::string& Name, const std::string& Abbr, cFont * DefaultFont = NULL ); + + virtual cUIPopUpMenu * CreatePopUpMenu( cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE | UI_AUTO_PADDING, Uint32 RowHeight = 0, eeRecti PaddingContainer = eeRecti(), Uint32 MinWidth = 100, Uint32 MinSpaceForIcons = 16, Uint32 MinRightMargin = 8 ); + + virtual cUIProgressBar * CreateProgressBar( cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS, bool DisplayPercent = true, bool VerticalExpand = false, eeVector2f MovementSpeed = eeVector2f( -64, 0 ), eeRectf FillerMargin = eeRectf() ); + + virtual cUIWinMenu * CreateWinMenu( cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS, Uint32 MarginBetweenButtons = 0, Uint32 ButtonMargin = 12, Uint32 MenuHeight = 0, Uint32 FirstButtonMargin = 1 ); + + virtual cUIWindow * CreateWindow( cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED, Uint32 WinFlags = UI_WIN_DEFAULT_FLAGS, eeSize MinWindowSize = eeSize(0,0), Uint8 BaseAlpha = 255 ); + + virtual cUICommonDialog * CreateCommonDialog( cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED, Uint32 WinFlags = UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON, eeSize MinWindowSize = eeSize(0,0), Uint8 BaseAlpha = 255, Uint32 CDLFlags = UI_CDL_DEFAULT_FLAGS, std::string DefaultFilePattern = "*", std::string DefaultDirectory = Sys::GetProcessPath() ); + + virtual cUIComboBox * CreateComboBox( cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, Uint32 MinNumVisibleItems = 6, bool PopUpToMainControl = false, cUIListBox * ListBox = NULL ); + + virtual cUIDropDownList * CreateDropDownList( cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, Uint32 MinNumVisibleItems = 6, bool PopUpToMainControl = false, cUIListBox * ListBox = NULL ); + + virtual cUIMessageBox * CreateMessageBox( UI_MSGBOX_TYPE Type = MSGBOX_OKCANCEL, const String& Message = String(), Uint32 WinFlags = UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL, cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED, eeSize MinWindowSize = eeSize(0,0), Uint8 BaseAlpha = 255 ); + + virtual cUITabWidget * CreateTabWidget( cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_HALIGN_CENTER | UI_VALIGN_BOTTOM | UI_CONTROL_DEFAULT_ANCHOR, const bool& TabsClosable = false, const bool& SpecialBorderTabs = false , const Int32& TabSeparation = 0, const Uint32& MaxTextLength = 30, const Uint32& TabWidgetHeight = 0, const Uint32& TabTextAlign = UI_HALIGN_CENTER | UI_VALIGN_CENTER, const Uint32& MinTabWidth = 32, const Uint32& MaxTabWidth = 210 ); + + virtual cUITooltip * CreateTooltip( cUIControl * TooltipOf, cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_PADDING | UI_AUTO_SIZE ); +}; + +}} + +#endif diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index 8ffbe7c69..709eb17b9 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget @@ -48,7 +48,7 @@ Desktop Desktop {388e5431-b31b-42b3-b9ad-9002d279d75d} - 10 + 0 0 0 diff --git a/projects/linux/ee.files b/projects/linux/ee.files index cdf28d3d1..5711b50a6 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -584,3 +584,5 @@ ../../include/eepp/base/noncopyable.hpp ../../include/eepp/system/clock.hpp ../../src/eepp/system/clock.cpp +../../src/eepp/ui/cuidefaulttheme.cpp +../../include/eepp/ui/cuidefaulttheme.hpp diff --git a/src/eepp/gaming/cmap.cpp b/src/eepp/gaming/cmap.cpp index ad6ac35dc..9663b02bd 100644 --- a/src/eepp/gaming/cmap.cpp +++ b/src/eepp/gaming/cmap.cpp @@ -35,6 +35,7 @@ cMap::cMap() : mData( NULL ), mTileOverColor( 255, 0, 0, 200 ), mBackColor( 204, 204, 204, 255 ), + mGridLinesColor( 255, 255, 255 ,255 ), mBackAlpha( 255 ), mMouseOver( false ), mScale( 1 ), @@ -123,7 +124,7 @@ void cMap::CreateEmptyTile() { if ( NULL == Tex ) { Uint32 x, y; - eeColorA Col( 255, 255, 255, 255 ); + eeColorA Col( mGridLinesColor ); cImage Img( mTileSize.Width(), mTileSize.Height(), 4 ); @@ -1455,4 +1456,12 @@ Uint32 cMap::GetNewObjectId() { return ++mLastObjId; } +void cMap::GridLinesColor( const eeColorA& Col ) { + mGridLinesColor = Col; +} + +const eeColorA& cMap::GridLinesColor() const { + return mGridLinesColor; +} + }} diff --git a/src/eepp/gaming/mapeditor/cmapeditor.cpp b/src/eepp/gaming/mapeditor/cmapeditor.cpp index 13676c5b9..44307268b 100644 --- a/src/eepp/gaming/mapeditor/cmapeditor.cpp +++ b/src/eepp/gaming/mapeditor/cmapeditor.cpp @@ -430,10 +430,32 @@ void cMapEditor::OnObjectModeSel( const cUIEvent * Event ) { } void cMapEditor::CreateUIMap() { + cUISkin * HScrollSkin = mTheme->GetByName( mTheme->Abbr() + "_" + "hscrollbar_bg" ); + cUISkin * VScrollSkin = mTheme->GetByName( mTheme->Abbr() + "_" + "vscrollbar_bg" ); + + eeFloat ScrollH = 16; + eeFloat ScrollV = 16; + + if ( NULL != HScrollSkin ) { + cSubTexture * tTex = HScrollSkin->GetSubTexture( cUISkinState::StateNormal ); + + if ( NULL != tTex ) { + ScrollH = tTex->Size().Height(); + } + } + + if ( NULL != VScrollSkin ) { + cSubTexture * tTex = VScrollSkin->GetSubTexture( cUISkinState::StateNormal ); + + if ( NULL != tTex ) { + ScrollV = tTex->Size().Height(); + } + } + cUIComplexControl::CreateParams Params; Params.Parent( mWinContainer ); Params.PosSet( 0, 0 ); - Params.SizeSet( mWinContainer->Size().Width() - 220, mWinContainer->Size().Height() - 16 ); + Params.SizeSet( mWinContainer->Size().Width() - 225 - ScrollV, mWinContainer->Size().Height() - ScrollH ); Params.Flags |= UI_ANCHOR_BOTTOM | UI_ANCHOR_RIGHT; mUIMap = eeNew( cUIMap, ( Params, mTheme ) ); @@ -449,10 +471,10 @@ void cMapEditor::CreateUIMap() { mUIMap->SetAlertCb( cb::Make2( this, &cMapEditor::CreateAlert ) ); mUIMap->SetTileBox( mTileBox ); - mMapHScroll = mTheme->CreateScrollBar( mWinContainer, eeSize( Params.Size.Width(), 15 ), eeVector2i( 0, Params.Size.Height() ), UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM ); + mMapHScroll = mTheme->CreateScrollBar( mWinContainer, eeSize( Params.Size.Width(), 15 ), eeVector2i( 0, Params.Size.Height() ), UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM | UI_AUTO_SIZE ); mMapHScroll->AddEventListener( cUIEvent::EventOnValueChange, cb::Make1( this, &cMapEditor::OnScrollMapH ) ); - mMapVScroll = mTheme->CreateScrollBar( mWinContainer, eeSize( 15, Params.Size.Height() ), eeVector2i( Params.Size.Width(), 0 ), UI_ANCHOR_TOP | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM, true ); + mMapVScroll = mTheme->CreateScrollBar( mWinContainer, eeSize( 15, Params.Size.Height() ), eeVector2i( Params.Size.Width(), 0 ), UI_ANCHOR_TOP | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM | UI_AUTO_SIZE , true ); mMapVScroll->AddEventListener( cUIEvent::EventOnValueChange, cb::Make1( this, &cMapEditor::OnScrollMapV ) ); MapCreated(); diff --git a/src/eepp/gaming/mapeditor/cuimap.cpp b/src/eepp/gaming/mapeditor/cuimap.cpp index f75293e12..c5835477f 100644 --- a/src/eepp/gaming/mapeditor/cuimap.cpp +++ b/src/eepp/gaming/mapeditor/cuimap.cpp @@ -29,6 +29,9 @@ cUIMap::cUIMap( const cUIComplexControl::CreateParams& Params, cUITheme * Theme, mMap = eeNew( cMap, () ); } + mMap->BackColor( eeColorA( 100, 100, 100, 100 ) ); + mMap->GridLinesColor( eeColorA( 150, 150, 150, 150 ) ); + mMap->SetDrawCallback( cb::Make0( this, &cUIMap::MapDraw ) ); UpdateScreenPos(); diff --git a/src/eepp/gaming/mapeditor/cuimapnew.cpp b/src/eepp/gaming/mapeditor/cuimapnew.cpp index a9585b57d..749c639b5 100644 --- a/src/eepp/gaming/mapeditor/cuimapnew.cpp +++ b/src/eepp/gaming/mapeditor/cuimapnew.cpp @@ -229,12 +229,19 @@ void cUIMapNew::OKClick( const cUIEvent * Event ) { mUIMap->Map()->Create( eeSize( w, h ), ml, eeSize( tw, th ), Flags, mUIMap->Map()->ViewSize() ); mUIMap->Map()->BaseColor( mUIBaseColor->Background()->Color() ); } else { - std::string path( mUIMap->Map()->Path() ); + std::string mapPath( Sys::GetTempPath() + "temp.eepp.map.eem" ); + mUIMap->Map()->Save( mapPath ); + cMap * Map = eeNew( cMap, () ); + Map->BackColor( eeColorA( 100, 100, 100, 100 ) ); + Map->GridLinesColor( eeColorA( 150, 150, 150, 150 ) ); Map->ForceHeadersOnLoad( eeSize( w, h ), eeSize( tw, th ), ml, Flags ); - Map->Load( path ); + Map->Load( mapPath ); Map->DisableForcedHeaders(); + mUIMap->ReplaceMap( Map ); + + FileSystem::FileRemove( mapPath ); } if ( mNewMapCb.IsSet() ) diff --git a/src/eepp/system/filesystem.cpp b/src/eepp/system/filesystem.cpp index 4c5a871c8..cc4fa1b1c 100644 --- a/src/eepp/system/filesystem.cpp +++ b/src/eepp/system/filesystem.cpp @@ -137,6 +137,10 @@ bool FileSystem::FileWrite( const std::string& filepath, const std::vector ( &data[0] ), (Uint32)data.size() ); } +bool FileSystem::FileRemove( const std::string& filepath ) { + return 0 == remove( filepath.c_str() ); +} + Uint32 FileSystem::FileGetModificationDate( const std::string& Filepath ) { struct stat st; int res = stat( Filepath.c_str(), &st ); diff --git a/src/eepp/system/sys.cpp b/src/eepp/system/sys.cpp index 7ea4f72d6..a900a5731 100644 --- a/src/eepp/system/sys.cpp +++ b/src/eepp/system/sys.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -26,6 +27,7 @@ #elif EE_PLATFORM == EE_PLATFORM_WIN #include #undef GetDiskFreeSpace + #undef GetTempPath #elif EE_PLATFORM == EE_PLATFORM_LINUX || EE_PLATFORM == EE_PLATFORM_ANDROID #include #include @@ -574,6 +576,38 @@ std::string Sys::GetConfigPath( std::string appname ) { return std::string( path ); } +std::string Sys::GetTempPath() { + char path[EE_MAX_CFG_PATH_LEN]; + + #if EE_PLATFORM == EE_PLATFORM_WIN + DWORD dwRetVal = GetTempPathA(EE_MAX_CFG_PATH_LEN, path); + + if ( 0 <= dwRetVal || dwRetVal > EE_MAX_CFG_PATH_LEN ) { + return std::string( "C:\\WINDOWS\\TEMP\\" ); + } + #elif EE_PLATFORM == EE_PLATFORM_ANDROID + if ( NULL != Window::cEngine::instance() ) { + String::StrCopy( path, Window::cEngine::instance()->GetCurrentWindow()->GetInternalStoragePath().c_str(), EE_MAX_CFG_PATH_LEN ); + } else { + String::StrCopy( path, "/tmp", EE_MAX_CFG_PATH_LEN ); + } + #else + char * tmpdir = getenv("TMPDIR"); + + if ( NULL != tmpdir ) { + String::StrCopy( path, tmpdir, EE_MAX_CFG_PATH_LEN ); + } else { + String::StrCopy( path, "/tmp", EE_MAX_CFG_PATH_LEN ); + } + #endif + + std::string rpath( path ); + + FileSystem::DirPathAddSlashAtEnd( rpath ); + + return rpath; +} + eeInt Sys::GetCPUCount() { eeInt nprocs = -1; diff --git a/src/eepp/ui/cuiaquatheme.cpp b/src/eepp/ui/cuiaquatheme.cpp index 6d19b9e28..ad7e6e4fa 100644 --- a/src/eepp/ui/cuiaquatheme.cpp +++ b/src/eepp/ui/cuiaquatheme.cpp @@ -89,12 +89,8 @@ cUIWindow * cUIAquaTheme::CreateWindow( cUIControl * Parent, const eeSize& Size, WinParams.BaseAlpha = BaseAlpha; if ( UseDefaultThemeValues() ) { - if ( !( WinParams.Flags & UI_DRAW_SHADOW ) ) - WinParams.Flags |= UI_DRAW_SHADOW; - - if ( !( WinParams.WinFlags & UI_WIN_DRAW_SHADOW ) ) - WinParams.WinFlags |= UI_WIN_DRAW_SHADOW; - + WinParams.Flags |= UI_DRAW_SHADOW; + WinParams.WinFlags |= UI_WIN_DRAW_SHADOW; WinParams.ButtonsPositionFixer.x = -2; WinParams.TitleFontColor = eeColorA( 0, 0, 0, 255 ); } @@ -116,12 +112,8 @@ cUICommonDialog * cUIAquaTheme::CreateCommonDialog( cUIControl * Parent, const e DLGParams.CDLFlags = CDLFlags; if ( UseDefaultThemeValues() ) { - if ( !( DLGParams.Flags & UI_DRAW_SHADOW ) ) - DLGParams.Flags |= UI_DRAW_SHADOW; - - if ( !( DLGParams.WinFlags & UI_WIN_DRAW_SHADOW ) ) - DLGParams.WinFlags |= UI_WIN_DRAW_SHADOW; - + DLGParams.Flags |= UI_DRAW_SHADOW; + DLGParams.WinFlags |= UI_WIN_DRAW_SHADOW; DLGParams.ButtonsPositionFixer.x = -2; DLGParams.TitleFontColor = eeColorA( 0, 0, 0, 255 ); } @@ -142,12 +134,8 @@ cUIMessageBox * cUIAquaTheme::CreateMessageBox( UI_MSGBOX_TYPE Type, const Strin MsgBoxParams.Message = Message; if ( UseDefaultThemeValues() ) { - if ( !( MsgBoxParams.Flags & UI_DRAW_SHADOW ) ) - MsgBoxParams.Flags |= UI_DRAW_SHADOW; - - if ( !( MsgBoxParams.WinFlags & UI_WIN_DRAW_SHADOW ) ) - MsgBoxParams.WinFlags |= UI_WIN_DRAW_SHADOW; - + MsgBoxParams.Flags |= UI_DRAW_SHADOW; + MsgBoxParams.WinFlags |= UI_WIN_DRAW_SHADOW; MsgBoxParams.ButtonsPositionFixer.x = -2; MsgBoxParams.TitleFontColor = eeColorA( 0, 0, 0, 255 ); } @@ -166,9 +154,7 @@ cUIComboBox * cUIAquaTheme::CreateComboBox( cUIControl * Parent, const eeSize& S ComboParams.ListBox = ListBox; if ( UseDefaultThemeValues() ) { - if ( !( ComboParams.Flags & UI_AUTO_SIZE ) ) { - ComboParams.Flags |= UI_AUTO_SIZE; - } + ComboParams.Flags |= UI_AUTO_SIZE; } cUIComboBox * Ctrl = eeNew( cUIComboBox, ( ComboParams ) ); @@ -188,9 +174,7 @@ cUIDropDownList * cUIAquaTheme::CreateDropDownList( cUIControl * Parent, const e DDLParams.ListBox = ListBox; if ( UseDefaultThemeValues() ) { - if ( !( DDLParams.Flags & UI_AUTO_SIZE ) ) { - DDLParams.Flags |= UI_AUTO_SIZE; - } + DDLParams.Flags |= UI_AUTO_SIZE; } cUIDropDownList * Ctrl = eeNew( cUIDropDownList, ( DDLParams ) ); diff --git a/src/eepp/ui/cuicommondialog.cpp b/src/eepp/ui/cuicommondialog.cpp index e7d99832f..db500e6bf 100644 --- a/src/eepp/ui/cuicommondialog.cpp +++ b/src/eepp/ui/cuicommondialog.cpp @@ -8,7 +8,7 @@ namespace EE { namespace UI { #define CDLG_MIN_WIDTH 420 -#define CDLG_MIN_HEIGHT 267 +#define CDLG_MIN_HEIGHT 300 cUICommonDialog::cUICommonDialog( const cUICommonDialog::CreateParams& Params ) : cUIWindow( Params ), @@ -43,10 +43,18 @@ cUICommonDialog::cUICommonDialog( const cUICommonDialog::CreateParams& Params ) TBox->Text( "Look in:" ); cUIPushButton::CreateParams ButtonParams; - ButtonParams.Parent( Container() ); - ButtonParams.PosSet( Container()->Size().Width() - 86, Container()->Size().Height() - 54 ); - ButtonParams.SizeSet( 80, 22 ); ButtonParams.Flags = UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_VALIGN_CENTER | UI_AUTO_SIZE; + ButtonParams.Parent( Container() ); + ButtonParams.PosSet( Container()->Size().Width() - 86, Container()->Size().Height() - 24 ); + ButtonParams.SizeSet( 80, 22 ); + mButtonCancel = eeNew( cUIPushButton, ( ButtonParams ) ); + mButtonCancel->Visible( true ); + mButtonCancel->Enabled( true ); + mButtonCancel->Text( "Cancel" ); + mButtonCancel->Pos( eeVector2i( mButtonCancel->Pos().x, Container()->Size().Height() - mButtonCancel->Size().Height() - 2 ) ); + mButtonCancel->UpdateAnchorsDistances(); + + ButtonParams.PosSet( mButtonCancel->Pos().x, mButtonCancel->Pos().y - mButtonCancel->Size().Height() ); mButtonOpen = eeNew( cUIPushButton, ( ButtonParams ) ); mButtonOpen->Visible( true ); mButtonOpen->Enabled( true ); @@ -56,12 +64,6 @@ cUICommonDialog::cUICommonDialog( const cUICommonDialog::CreateParams& Params ) else mButtonOpen->Text( "Open" ); - ButtonParams.Pos.y = mButtonOpen->Pos().y + mButtonOpen->Size().Height() + 6; - mButtonCancel = eeNew( cUIPushButton, ( ButtonParams ) ); - mButtonCancel->Visible( true ); - mButtonCancel->Enabled( true ); - mButtonCancel->Text( "Cancel" ); - cUITextInput::CreateParams TInputParams; TInputParams.Parent( Container() ); TInputParams.Flags = UI_AUTO_PADDING | UI_CLIP_ENABLE | UI_ANCHOR_RIGHT | UI_ANCHOR_LEFT | UI_ANCHOR_TOP | UI_VALIGN_CENTER; @@ -83,8 +85,16 @@ cUICommonDialog::cUICommonDialog( const cUICommonDialog::CreateParams& Params ) cUIListBox::CreateParams LBParams; LBParams.Parent( Container() ); - LBParams.PosSet( 6, 33 ); - LBParams.Size = eeSize( Container()->Size().Width() - 12, Container()->Size().Height() - 92 ); + LBParams.PosSet( 6, mButtonUp->Pos().y + mButtonUp->Size().Height() + 4 ); + LBParams.Size = eeSize( Container()->Size().Width() - 12, + Container()->Size().Height() - + mButtonUp->Size().Height() - + mButtonUp->Pos().y - + mButtonOpen->Size().Height() - + mButtonCancel->Size().Height() - + 8 + ); + LBParams.Flags = UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_LEFT | UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM | UI_CLIP_ENABLE; LBParams.FontSelectedColor = eeColorA( 255, 255, 255, 255 ); @@ -124,7 +134,7 @@ cUICommonDialog::cUICommonDialog( const cUICommonDialog::CreateParams& Params ) DDLParams.Parent( Container() ); DDLParams.PosSet( TBox2->Pos().x + TBox2->Size().Width(), TBox2->Pos().y ); DDLParams.SizeSet( Container()->Size().Width() - mButtonCancel->Size().Width() - DDLParams.Pos.x - 20, 22 ); - DDLParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT; + DDLParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_AUTO_SIZE; DDLParams.PopUpToMainControl = true; mFiletype = eeNew( cUIDropDownList, ( DDLParams ) ); mFiletype->Visible( true ); diff --git a/src/eepp/ui/cuicomplexcontrol.cpp b/src/eepp/ui/cuicomplexcontrol.cpp index 045e8b87f..90aef3b21 100644 --- a/src/eepp/ui/cuicomplexcontrol.cpp +++ b/src/eepp/ui/cuicomplexcontrol.cpp @@ -87,10 +87,18 @@ void cUIComplexControl::CreateTooltip() { if ( NULL != mTooltip ) return; - cUITooltip::CreateParams Params; - Params.Parent( cUIManager::instance()->MainControl() ); - Params.Flags = UI_VALIGN_CENTER | UI_HALIGN_CENTER | UI_AUTO_PADDING | UI_AUTO_SIZE; - mTooltip = eeNew( cUITooltip, ( Params, this ) ); + cUITheme * tTheme = cUIThemeManager::instance()->DefaultTheme(); + + if ( NULL != tTheme ) { + mTooltip = tTheme->CreateTooltip( this, cUIManager::instance()->MainControl() ); + mTooltip->Visible( false ); + mTooltip->Enabled( false ); + } else { + cUITooltip::CreateParams Params; + Params.Parent( cUIManager::instance()->MainControl() ); + Params.Flags = UI_VALIGN_CENTER | UI_HALIGN_CENTER | UI_AUTO_PADDING | UI_AUTO_SIZE; + mTooltip = eeNew( cUITooltip, ( Params, this ) ); + } } void cUIComplexControl::TooltipText( const String& Text ) { diff --git a/src/eepp/ui/cuidefaulttheme.cpp b/src/eepp/ui/cuidefaulttheme.cpp new file mode 100644 index 000000000..9d4cfa92e --- /dev/null +++ b/src/eepp/ui/cuidefaulttheme.cpp @@ -0,0 +1,236 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +namespace EE { namespace UI { + +cUIDefaultTheme::cUIDefaultTheme( const std::string& Name, const std::string& Abbr, cFont * DefaultFont ) : + cUITheme( Name, Abbr, DefaultFont ) +{ + FontColor( eeColorA( 230, 230, 230, 255 ) ); + FontOverColor( eeColorA( 255, 255, 255, 255 ) ); + FontSelectedColor( eeColorA( 255, 255, 255, 255 ) ); + FontShadowColor( eeColorA( 50, 50, 50, 150 ) ); +} + +cUIPopUpMenu * cUIDefaultTheme::CreatePopUpMenu( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, Uint32 RowHeight, eeRecti PaddingContainer, Uint32 MinWidth, Uint32 MinSpaceForIcons, Uint32 MinRightMargin ) { + cUIPopUpMenu::CreateParams MenuParams; + MenuParams.Parent( Parent ); + MenuParams.PosSet( Pos ); + MenuParams.SizeSet( Size ); + MenuParams.Flags = Flags; + MenuParams.RowHeight = RowHeight; + MenuParams.PaddingContainer = PaddingContainer; + MenuParams.MinWidth = MinWidth; + MenuParams.MinSpaceForIcons = MinSpaceForIcons; + MenuParams.MinRightMargin = MinRightMargin; + + if ( UseDefaultThemeValues() ) { + MenuParams.MinWidth = 100; + MenuParams.MinSpaceForIcons = 24; + MenuParams.MinRightMargin = 8; + MenuParams.FontColor = eeColorA( 230, 230, 230, 255 ); + } + + return eeNew( cUIPopUpMenu, ( MenuParams ) ); +} + +cUIProgressBar * cUIDefaultTheme::CreateProgressBar( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, bool DisplayPercent, bool VerticalExpand, eeVector2f MovementSpeed, eeRectf FillerMargin ) { + cUIProgressBar::CreateParams PBParams; + PBParams.Parent( Parent ); + PBParams.PosSet( Pos ); + PBParams.SizeSet( Size ); + PBParams.Flags = Flags; + PBParams.DisplayPercent = DisplayPercent; + PBParams.VerticalExpand = VerticalExpand; + PBParams.MovementSpeed = MovementSpeed; + PBParams.FillerMargin = FillerMargin; + + if ( UseDefaultThemeValues() ) { + PBParams.Flags |= UI_AUTO_SIZE; + PBParams.DisplayPercent = true; + PBParams.VerticalExpand = true; + PBParams.FillerMargin = eeRectf( 2, 2, 2, 2 ); + } + + cUIProgressBar * Ctrl = eeNew( cUIProgressBar, ( PBParams ) ); + Ctrl->Visible( true ); + Ctrl->Enabled( true ); + return Ctrl; +} +cUIWinMenu * cUIDefaultTheme::CreateWinMenu( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, Uint32 MarginBetweenButtons, Uint32 ButtonMargin, Uint32 MenuHeight, Uint32 FirstButtonMargin ) { + cUIWinMenu::CreateParams WinMenuParams; + WinMenuParams.Parent( Parent ); + WinMenuParams.PosSet( Pos ); + WinMenuParams.SizeSet( Size ); + WinMenuParams.Flags = Flags; + WinMenuParams.MarginBetweenButtons = MarginBetweenButtons; + WinMenuParams.ButtonMargin = ButtonMargin; + WinMenuParams.MenuHeight = MenuHeight; + WinMenuParams.FirstButtonMargin = FirstButtonMargin; + + if ( UseDefaultThemeValues() ) { + WinMenuParams.ButtonMargin = 12; + } + + cUIWinMenu * Ctrl = eeNew( cUIWinMenu, ( WinMenuParams ) ); + Ctrl->Visible( true ); + Ctrl->Enabled( true ); + return Ctrl; +} + +cUIWindow * cUIDefaultTheme::CreateWindow( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, Uint32 WinFlags, eeSize MinWindowSize, Uint8 BaseAlpha ) { + cUIWindow::CreateParams WinParams; + WinParams.Parent( Parent ); + WinParams.PosSet( Pos ); + WinParams.SizeSet( Size ); + WinParams.Flags = Flags; + WinParams.WinFlags = WinFlags; + WinParams.MinWindowSize = MinWindowSize; + WinParams.BaseAlpha = BaseAlpha; + + if ( UseDefaultThemeValues() ) { + WinParams.Flags |= UI_DRAW_SHADOW; + WinParams.WinFlags |= UI_WIN_DRAW_SHADOW; + WinParams.ButtonsPositionFixer.x = -2; + WinParams.TitleFontColor = eeColorA( 230, 230, 230, 255 ); + } + + return eeNew( cUIWindow, ( WinParams ) ); +} + +cUICommonDialog * cUIDefaultTheme::CreateCommonDialog( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, Uint32 WinFlags, eeSize MinWindowSize, Uint8 BaseAlpha, Uint32 CDLFlags, std::string DefaultFilePattern, std::string DefaultDirectory ) { + cUICommonDialog::CreateParams DLGParams; + DLGParams.Parent( Parent ); + DLGParams.PosSet( Pos ); + DLGParams.SizeSet( Size ); + DLGParams.Flags = Flags; + DLGParams.WinFlags = WinFlags; + DLGParams.MinWindowSize = MinWindowSize; + DLGParams.BaseAlpha = BaseAlpha; + DLGParams.DefaultDirectory = DefaultDirectory; + DLGParams.DefaultFilePattern = DefaultFilePattern; + DLGParams.CDLFlags = CDLFlags; + + if ( UseDefaultThemeValues() ) { + DLGParams.Flags |= UI_DRAW_SHADOW; + DLGParams.WinFlags |= UI_WIN_DRAW_SHADOW; + DLGParams.ButtonsPositionFixer.x = -2; + DLGParams.TitleFontColor = eeColorA( 230, 230, 230, 255 ); + } + + return eeNew( cUICommonDialog, ( DLGParams ) ); +} + +cUIMessageBox * cUIDefaultTheme::CreateMessageBox( UI_MSGBOX_TYPE Type, const String& Message, Uint32 WinFlags, cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, eeSize MinWindowSize, Uint8 BaseAlpha ) { + cUIMessageBox::CreateParams MsgBoxParams; + MsgBoxParams.Parent( Parent ); + MsgBoxParams.PosSet( Pos ); + MsgBoxParams.SizeSet( Size ); + MsgBoxParams.Flags = Flags; + MsgBoxParams.WinFlags = WinFlags; + MsgBoxParams.MinWindowSize = MinWindowSize; + MsgBoxParams.BaseAlpha = BaseAlpha; + MsgBoxParams.Type = Type; + MsgBoxParams.Message = Message; + + if ( UseDefaultThemeValues() ) { + MsgBoxParams.Flags |= UI_DRAW_SHADOW; + MsgBoxParams.WinFlags |= UI_WIN_DRAW_SHADOW; + MsgBoxParams.ButtonsPositionFixer.x = -2; + MsgBoxParams.TitleFontColor = eeColorA( 0, 0, 0, 255 ); + } + + return eeNew( cUIMessageBox, ( MsgBoxParams ) ); +} + +cUIComboBox * cUIDefaultTheme::CreateComboBox( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, Uint32 MinNumVisibleItems, bool PopUpToMainControl, cUIListBox * ListBox ) { + cUIComboBox::CreateParams ComboParams; + ComboParams.Parent( Parent ); + ComboParams.PosSet( Pos ); + ComboParams.SizeSet( Size ); + ComboParams.Flags = Flags; + ComboParams.MinNumVisibleItems = MinNumVisibleItems; + ComboParams.PopUpToMainControl = PopUpToMainControl; + ComboParams.ListBox = ListBox; + + if ( UseDefaultThemeValues() ) { + ComboParams.Flags |= UI_AUTO_SIZE; + } + + cUIComboBox * Ctrl = eeNew( cUIComboBox, ( ComboParams ) ); + Ctrl->Visible( true ); + Ctrl->Enabled( true ); + return Ctrl; +} + +cUIDropDownList * cUIDefaultTheme::CreateDropDownList( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, Uint32 MinNumVisibleItems, bool PopUpToMainControl, cUIListBox * ListBox ) { + cUIDropDownList::CreateParams DDLParams; + DDLParams.Parent( Parent ); + DDLParams.PosSet( Pos ); + DDLParams.SizeSet( Size ); + DDLParams.Flags = Flags; + DDLParams.MinNumVisibleItems = MinNumVisibleItems; + DDLParams.PopUpToMainControl = PopUpToMainControl; + DDLParams.ListBox = ListBox; + + if ( UseDefaultThemeValues() ) { + DDLParams.Flags |= UI_AUTO_SIZE; + } + + cUIDropDownList * Ctrl = eeNew( cUIDropDownList, ( DDLParams ) ); + Ctrl->Visible( true ); + Ctrl->Enabled( true ); + return Ctrl; +} + + +cUITabWidget * cUIDefaultTheme::CreateTabWidget( cUIControl *Parent, const eeSize &Size, const eeVector2i &Pos, const Uint32 &Flags, const bool &TabsClosable, const bool &SpecialBorderTabs, const Int32 &TabSeparation, const Uint32 &MaxTextLength, const Uint32 &TabWidgetHeight, const Uint32 &TabTextAlign, const Uint32 &MinTabWidth, const Uint32 &MaxTabWidth ) { + cUITabWidget::CreateParams TabWidgetParams; + TabWidgetParams.Parent( Parent ); + TabWidgetParams.PosSet( Pos ); + TabWidgetParams.SizeSet( Size ); + TabWidgetParams.Flags = Flags; + TabWidgetParams.TabsClosable = TabsClosable; + TabWidgetParams.SpecialBorderTabs = SpecialBorderTabs; + TabWidgetParams.TabSeparation = TabSeparation; + TabWidgetParams.MaxTextLength = MaxTextLength; + TabWidgetParams.TabWidgetHeight = TabWidgetHeight; + TabWidgetParams.TabTextAlign = TabTextAlign; + TabWidgetParams.MinTabWidth = MinTabWidth; + TabWidgetParams.MaxTabWidth = MaxTabWidth; + + if ( UseDefaultThemeValues() ) { + TabWidgetParams.TabSeparation = -1; + TabWidgetParams.FontSelectedColor = eeColorA( 255, 255, 255, 255 ); + } + + cUITabWidget * Ctrl = eeNew( cUITabWidget, ( TabWidgetParams ) ); + Ctrl->Visible( true ); + Ctrl->Enabled( true ); + return Ctrl; +} + +cUITooltip * cUIDefaultTheme::CreateTooltip( cUIControl * TooltipOf, cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags ) { + cUITooltip::CreateParams TooltipParams; + TooltipParams.Parent( Parent ); + TooltipParams.PosSet( Pos ); + TooltipParams.SizeSet( Size ); + TooltipParams.Flags = Flags; + + if ( UseDefaultThemeValues() ) { + TooltipParams.FontColor = eeColorA( 0, 0, 0, 255 ); + } + + cUITooltip * Ctrl = eeNew( cUITooltip, ( TooltipParams, TooltipOf ) ); + Ctrl->Visible( true ); + Ctrl->Enabled( true ); + return Ctrl; +} + +}} diff --git a/src/eepp/ui/cuiprogressbar.cpp b/src/eepp/ui/cuiprogressbar.cpp index e39dc42d8..51d6ebf43 100644 --- a/src/eepp/ui/cuiprogressbar.cpp +++ b/src/eepp/ui/cuiprogressbar.cpp @@ -54,6 +54,10 @@ void cUIProgressBar::Draw() { void cUIProgressBar::SetTheme( cUITheme * Theme ) { cUIControl::SetThemeControl( Theme, "progressbar" ); + if ( mFlags & UI_AUTO_SIZE ) { + Size( mSize.x, GetSkinSize().Height() ); + } + cUISkin * tSkin = Theme->GetByName( Theme->Abbr() + "_progressbar_filler" ); if ( tSkin ) { @@ -62,11 +66,14 @@ void cUIProgressBar::SetTheme( cUITheme * Theme ) { if ( NULL != tSubTexture ) { eeSAFE_DELETE( mParallax ); - eeFloat Height = (eeFloat)mSize.Height(); + eeFloat Height = (eeFloat)GetSkinSize().Height(); if ( !mVerticalExpand ) Height = (eeFloat)tSubTexture->RealSize().Height(); + if ( Height > mSize.Height() ) + Height = mSize.Height(); + mParallax = eeNew( cScrollParallax, ( tSubTexture, eeVector2f( mScreenPos.x + mFillerMargin.Left, mScreenPos.y + mFillerMargin.Top ), eeSizef( ( ( mSize.Width() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ), mSpeed ) ); } } @@ -87,6 +94,9 @@ void cUIProgressBar::OnSizeChange() { if ( !mVerticalExpand && mParallax->SubTexture() ) Height = (eeFloat)mParallax->SubTexture()->RealSize().Height(); + if ( Height > mSize.Height() ) + Height = mSize.Height(); + mParallax->Size( eeSizef( ( ( mSize.Width() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ) ); } diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index fa1cdc894..822d64438 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -139,13 +139,13 @@ void cEETest::Init() { } } -void cEETest::CreateAquaTextureAtlas() { +void cEETest::CreateUIThemeTextureAtlas() { #if !defined( EE_DEBUG ) || defined( EE_GLES ) return; #endif - std::string tgpath( MyPath + "aquata/aqua" ); - std::string Path( MyPath + "aqua" ); + std::string tgpath( MyPath + "uithemeta/uitheme" ); + std::string Path( MyPath + "uitheme" ); if ( !FileSystem::FileExists( tgpath + EE_TEXTURE_ATLAS_EXTENSION ) ) { cTexturePacker tp( 256, 256, true, 2 ); @@ -255,22 +255,22 @@ void cEETest::OnShowMenu( const cUIEvent * Event ) { void cEETest::CreateUI() { cTimeElapsed TE; - CreateAquaTextureAtlas(); + CreateUIThemeTextureAtlas(); Log->Writef( "Texture Atlas Loading Time: %f ms.", TE.ElapsedSinceStart() ); cUIManager::instance()->Init(); //UI_MANAGER_HIGHLIGHT_FOCUS - //mTheme = cUITheme::LoadFromPath( eeNew( cUIAquaTheme, ( "aqua", "aqua" ) ), MyPath + "aqua/" ); + //mTheme = cUITheme::LoadFromPath( eeNew( cUIDefaultTheme, ( "uitheme", "uitheme" ) ), MyPath + "uitheme/" ); - cTextureAtlasLoader tgl( MyPath + "aquata/aqua" + EE_TEXTURE_ATLAS_EXTENSION ); + cTextureAtlasLoader tgl( MyPath + "uithemeta/uitheme" + EE_TEXTURE_ATLAS_EXTENSION ); - mTheme = cUITheme::LoadFromTextureAtlas( eeNew( cUIAquaTheme, ( "aqua", "aqua" ) ), cTextureAtlasManager::instance()->GetByName( "aqua" ) ); + mTheme = cUITheme::LoadFromTextureAtlas( eeNew( cUIDefaultTheme, ( "uitheme", "uitheme" ) ), cTextureAtlasManager::instance()->GetByName( "uitheme" ) ); cUIThemeManager::instance()->Add( mTheme ); cUIThemeManager::instance()->DefaultEffectsEnabled( true ); cUIThemeManager::instance()->DefaultFont( TTF ); - cUIThemeManager::instance()->DefaultTheme( "aqua" ); + cUIThemeManager::instance()->DefaultTheme( "uitheme" ); cUIControl::CreateParams Params( cUIManager::instance()->MainControl(), eeVector2i(0,0), eeSize( 530, 380 ), UI_FILL_BACKGROUND | UI_CLIP_ENABLE | UI_BORDER ); @@ -403,15 +403,7 @@ void cEETest::CreateUI() { mScrollBar->Enabled( true ); mScrollBar->AddEventListener( cUIEvent::EventOnValueChange, cb::Make1( this, &cEETest::OnValueChange ) ); - cUIProgressBar::CreateParams PBParams; - PBParams.Parent( C ); - PBParams.PosSet( 20, 197 ); - PBParams.Size = eeSize( 200, 16 ); - PBParams.DisplayPercent = true; - PBParams.MovementSpeed = eeVector2f( -64, 0 ); - mProgressBar = eeNew( cUIProgressBar, ( PBParams ) ); - mProgressBar->Visible( true ); - mProgressBar->Enabled( true ); + mProgressBar = mTheme->CreateProgressBar( C, eeSize( 200, 20 ), eeVector2i( 20, 190 ) ); TextParams.PosSet( 20, 5 ); mTextBoxValue = eeNew( cUITextBox, ( TextParams ) ); @@ -1144,12 +1136,13 @@ void cEETest::Screen2() { PR.FillMode( EE_DRAW_LINE ); PR.DrawCircle( eeVector2f( Mousef.x, Mousef.y ), 80.f, (Uint32)(Ang/3) ); - PR.DrawTriangle( eeTriangle2f( eeVector2f( Mousef.x, Mousef.y - 10.f ), eeVector2f( Mousef.x - 10.f, Mousef.y + 10.f ), eeVector2f( Mousef.x + 10.f, Mousef.y + 10.f ) ) ); PR.DrawLine( eeLine2f( eeVector2f(Mousef.x - 80.f, Mousef.y - 80.f), eeVector2f(Mousef.x + 80.f, Mousef.y + 80.f) ) ); PR.DrawLine( eeLine2f( eeVector2f(Mousef.x - 80.f, Mousef.y + 80.f), eeVector2f(Mousef.x + 80.f, Mousef.y - 80.f) ) ); PR.DrawLine( eeLine2f( eeVector2f((eeFloat)mWindow->GetWidth(), 0.f), eeVector2f( 0.f, (eeFloat)mWindow->GetHeight() ) ) ); + PR.FillMode( EE_DRAW_FILL ); PR.DrawQuad( eeQuad2f( eeVector2f(0.f, 0.f), eeVector2f(0.f, 100.f), eeVector2f(150.f, 150.f), eeVector2f(200.f, 150.f) ), eeColorA(220, 240, 0, 125), eeColorA(100, 0, 240, 125), eeColorA(250, 50, 25, 125), eeColorA(50, 150, 150, 125) ); + PR.FillMode( EE_DRAW_LINE ); PR.DrawRectangle( eeRectf( eeVector2f( Mousef.x - 80.f, Mousef.y - 80.f ), eeSizef( 160.f, 160.f ) ), 45.f ); PR.DrawLine( eeLine2f( eeVector2f(0.f, 0.f), eeVector2f( (eeFloat)mWindow->GetWidth(), (eeFloat)mWindow->GetHeight() ) ) ); diff --git a/src/test/eetest.hpp b/src/test/eetest.hpp index 2d15c8e5a..7396550d2 100644 --- a/src/test/eetest.hpp +++ b/src/test/eetest.hpp @@ -216,7 +216,7 @@ class cEETest : private cThread { void OnWinMouseUp( const cUIEvent * Event ); void CreateDecoratedWindow(); void CreateWinMenu(); - void CreateAquaTextureAtlas(); + void CreateUIThemeTextureAtlas(); cUIControlAnim * C; cUIScrollBar * mScrollBar;