MCPcopy Create free account
hub / github.com/NatLabRockies/SAM / LoadFormList

Method LoadFormList

src/ide.cpp:1007–1040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1005}
1006
1007void UIEditorPanel::LoadFormList( const wxString &sel )
1008{
1009
1010 wxArrayString list;
1011
1012 wxDir dir( SamApp::GetRuntimePath() + "/ui" );
1013 if ( dir.IsOpened() )
1014 {
1015 wxString file;
1016#ifdef UI_BINARY
1017 bool has_more = dir.GetFirst( &file, "*.ui", wxDIR_FILES );
1018#elif defined(__LOAD_AS_JSON__)
1019 bool has_more = dir.GetFirst(&file, "*.json", wxDIR_FILES);
1020#else
1021 bool has_more = dir.GetFirst(&file, "*.txt", wxDIR_FILES);
1022#endif
1023 while( has_more )
1024 {
1025 wxFileName fn( file );
1026 list.Add( fn.GetName() );
1027 has_more = dir.GetNext( &file );
1028 }
1029 }
1030
1031 list.Sort();
1032
1033 m_formList->Freeze();
1034 m_formList->Clear();
1035 m_formList->Append( list );
1036 m_formList->Thaw();
1037
1038 if ( !sel.IsEmpty() )
1039 m_formList->SetStringSelection( sel );
1040}
1041
1042void UIEditorPanel::OnCallbackGoto( wxCommandEvent &evt )
1043{

Callers

nothing calls this directly

Calls 4

SortMethod · 0.80
AddMethod · 0.45
GetNameMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected