mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
A couple of quick fixes for the Map Editor.
This commit is contained in:
@@ -269,8 +269,12 @@ void cMapEditor::FillSGCombo() {
|
||||
|
||||
std::vector<String> items;
|
||||
|
||||
Uint32 Restricted1 = MakeHash( std::string( "global" ) );
|
||||
Uint32 Restricted2 = MakeHash( mTheme->ShapeGroup()->Name() );
|
||||
|
||||
for ( std::list<cShapeGroup*>::iterator it = Res.begin(); it != Res.end(); it++ ) {
|
||||
items.push_back( reinterpret_cast<cShapeGroup*>( *it )->Name() );
|
||||
if ( (*it)->Id() != Restricted1 && (*it)->Id() != Restricted2 )
|
||||
items.push_back( (*it)->Name() );
|
||||
}
|
||||
|
||||
if ( items.size() ) {
|
||||
@@ -293,7 +297,7 @@ void cMapEditor::FillShapeList() {
|
||||
std::vector<String> items;
|
||||
|
||||
for ( std::list<cShape*>::iterator it = Res.begin(); it != Res.end(); it++ ) {
|
||||
items.push_back( (*it)->Name() );
|
||||
items.push_back( (*it)->Name() );
|
||||
}
|
||||
|
||||
if ( items.size() ) {
|
||||
@@ -322,6 +326,9 @@ void cMapEditor::CreateNewMap() {
|
||||
}
|
||||
|
||||
void cMapEditor::MapCreated() {
|
||||
mLayerList->ListBox()->Clear();
|
||||
FillSGCombo();
|
||||
|
||||
mMapHScroll->Value( 0 );
|
||||
mMapVScroll->Value( 0 );
|
||||
OnMapSizeChange( NULL );
|
||||
|
||||
@@ -74,4 +74,7 @@ Uint32 cUIComboBox::OnMouseClick( const eeVector2i& Pos, const Uint32 Flags ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void cUIComboBox::OnControlClear( const cUIEvent *Event ) {
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -20,6 +20,8 @@ class EE_API cUIComboBox : public cUIDropDownList {
|
||||
Uint32 OnMouseClick( const eeVector2i& Pos, const Uint32 Flags );
|
||||
|
||||
void CreateButton();
|
||||
|
||||
virtual void OnControlClear( const cUIEvent *Event );
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -31,6 +31,7 @@ cUIDropDownList::cUIDropDownList( cUIDropDownList::CreateParams& Params ) :
|
||||
mListBox->AddEventListener( cUIEvent::EventOnItemClicked, cb::Make1( this, &cUIDropDownList::OnItemClicked ) );
|
||||
mListBox->AddEventListener( cUIEvent::EventOnItemKeyDown, cb::Make1( this, &cUIDropDownList::OnItemKeyDown ) );
|
||||
mListBox->AddEventListener( cUIEvent::EventKeyDown , cb::Make1( this, &cUIDropDownList::OnItemKeyDown ) );
|
||||
mListBox->AddEventListener( cUIEvent::EventOnControlClear, cb::Make1( this, &cUIDropDownList::OnControlClear ) );
|
||||
}
|
||||
|
||||
cUIDropDownList::~cUIDropDownList() {
|
||||
@@ -100,6 +101,10 @@ void cUIDropDownList::ShowListBox() {
|
||||
}
|
||||
}
|
||||
|
||||
void cUIDropDownList::OnControlClear( const cUIEvent * Event ) {
|
||||
Text( "" );
|
||||
}
|
||||
|
||||
void cUIDropDownList::OnItemKeyDown( const cUIEvent * Event ) {
|
||||
const cUIEventKey * KEvent = reinterpret_cast<const cUIEventKey*> ( Event );
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@ class EE_API cUIDropDownList : public cUITextInput {
|
||||
|
||||
virtual void OnItemKeyDown( const cUIEvent * Event );
|
||||
|
||||
virtual void OnControlClear( const cUIEvent * Event );
|
||||
|
||||
Uint32 OnKeyDown( const cUIEventKey &Event );
|
||||
|
||||
virtual void OnSizeChange();
|
||||
|
||||
@@ -45,6 +45,7 @@ class EE_API cUIEvent {
|
||||
EventOnWindowMaximizeClick,
|
||||
EventOnWindowMinimizeClick,
|
||||
EventOpenFile,
|
||||
EventOnControlClear,
|
||||
EventUser,
|
||||
EventForceDWord = 0xFFFFFFFF
|
||||
};
|
||||
|
||||
@@ -227,6 +227,8 @@ void cUIListBox::Clear() {
|
||||
UpdateScroll();
|
||||
FindMaxWidth();
|
||||
UpdateListBoxItemsSize();
|
||||
|
||||
SendCommonEvent( cUIEvent::EventOnControlClear );
|
||||
}
|
||||
|
||||
Uint32 cUIListBox::RemoveListBoxItem( Uint32 ItemIndex ) {
|
||||
|
||||
Reference in New Issue
Block a user