void comboView_SelectedIndexChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments)
 {
     switch(comboView->GetSelectedIndex())
     {
         case 0:
             listView->ChangeItemStyle(new list::ListViewBigIconContentProvider);
             break;
         case 1:
             listView->ChangeItemStyle(new list::ListViewSmallIconContentProvider);
             break;
         case 2:
             listView->ChangeItemStyle(new list::ListViewListContentProvider);
             break;
         case 3:
             listView->ChangeItemStyle(new list::ListViewDetailContentProvider);
             break;
         case 4:
             listView->ChangeItemStyle(new list::ListViewTileContentProvider);
             break;
         case 5:
             listView->ChangeItemStyle(new list::ListViewInformationContentProvider);
             break;
     }
 }
Пример #2
0
 void comboSelector_SelectedIndexChanged(GuiGraphicsComposition* sender, GuiEventArgs& arguments)
 {
     comboSelector->SetEnabled(false);
     this->GetBoundsComposition()->SetAssociatedCursor(GetCurrentController()->ResourceService()->GetSystemCursor(INativeCursor::LargeWaiting));
     
     GetApplication()->InvokeAsync([=]()
                                   {
                                       Ptr<GuiTextBoxColorizerBase> colorizer;
                                       WString text;
                                       
                                       switch(comboSelector->GetSelectedIndex())
                                       {
                                           case 0:
                                               text=
                                               L";This is a comment\r\n"
                                               L"[Section1]\r\n"
                                               L"Name=John Smith\r\n"
                                               L"ID=008\r\n"
                                               L"\r\n"
                                               L"[Section2]\r\n"
                                               L"Name=Kyon\r\n"
                                               L"ID=009\r\n"
                                               ;
                                               break;
                                           case 1:
                                               text=
                                               L"<books>\r\n"
                                               L"\t<!--Comment-->\r\n"
                                               L"\t<book name=\"C++Primer\">\r\n"
                                               L"\t\tContent\r\n"
                                               L"\t</book>\r\n"
                                               L"\t<![CDATA[<xml/>]]>\r\n"
                                               L"</books>\r\n"
                                               ;
                                               break;
                                           case 2:
                                               text=
                                               L"#include <iostream>\r\n"
                                               L"using namespace std;\r\n"
                                               L"\r\n"
                                               L"int main()\r\n"
                                               L"{\r\n"
                                               L"\t//This is a comment\r\n"
                                               L"\t/**This*is/another\r\n"
                                               L"\tcomment**/\r\n"
                                               L"\tcout<<\"Hello, world!\"<<endl;\r\n"
                                               L"\treturn 0;\r\n"
                                               L"}\r\n"
                                               ;
                                               break;
                                       }
                                       
                                       GetApplication()->InvokeInMainThreadAndWait([=]()
                                                                                   {
                                                                                       textBox->SetColorizer(0);
                                                                                       textBox->SetText(text);
                                                                                   });
                                       
                                       switch(comboSelector->GetSelectedIndex())
                                       {
                                           case 0:
                                               colorizer=new IniColorizer;
                                               break;
                                           case 1:
                                               colorizer=new XmlColorizer;
                                               break;
                                           case 2:
                                               colorizer=new CppColorizer;
                                               break;
                                       }
                                       
                                       GetApplication()->InvokeInMainThreadAndWait([=]()
                                                                                   {
                                                                                       textBox->SetColorizer(colorizer);
                                                                                       GetBoundsComposition()->SetAssociatedCursor(GetCurrentController()->ResourceService()->GetDefaultSystemCursor());
                                                                                       comboSelector->SetEnabled(true);
                                                                                   });
                                   });
 }