| 894 | |
| 895 | |
| 896 | void ChildFrame::OnTreeSelected(wxTreeEvent& event) { |
| 897 | const auto selected_item = event.GetItem(); |
| 898 | const auto selected_id = GetBlockId(left_,selected_item); |
| 899 | |
| 900 | auto* doc = GetDoc(); |
| 901 | if (doc == nullptr) { |
| 902 | return; |
| 903 | } |
| 904 | |
| 905 | // Check which list |
| 906 | auto* current_window = splitter_->GetWindow2(); |
| 907 | switch (selected_id) { |
| 908 | case kHistoryPosition: |
| 909 | if (current_window != history_view_) { |
| 910 | current_window->Hide(); |
| 911 | splitter_->ReplaceWindow(current_window, history_view_); |
| 912 | history_view_->Show(); |
| 913 | RedrawHistoryView(); |
| 914 | } |
| 915 | return; |
| 916 | |
| 917 | case kMeasurementPosition: |
| 918 | if (current_window != measurement_view_) { |
| 919 | current_window->Hide(); |
| 920 | splitter_->ReplaceWindow(current_window, measurement_view_); |
| 921 | measurement_view_->Show(); |
| 922 | RedrawMeasurementView(); |
| 923 | } |
| 924 | return; |
| 925 | |
| 926 | case kEventPosition: |
| 927 | if (current_window != event_view_) { |
| 928 | current_window->Hide(); |
| 929 | splitter_->ReplaceWindow(current_window, event_view_); |
| 930 | event_view_->Show(); |
| 931 | RedrawEventView(); |
| 932 | } |
| 933 | return; |
| 934 | |
| 935 | case kAttachmentPosition: |
| 936 | if (current_window != attachment_view_) { |
| 937 | current_window->Hide(); |
| 938 | splitter_->ReplaceWindow(current_window, attachment_view_); |
| 939 | attachment_view_->Show(); |
| 940 | RedrawAttachmentView(); |
| 941 | } |
| 942 | return; |
| 943 | |
| 944 | case kHierarchyPosition: |
| 945 | if (current_window != hierarchy_view_) { |
| 946 | current_window->Hide(); |
| 947 | splitter_->ReplaceWindow(current_window, hierarchy_view_); |
| 948 | hierarchy_view_->Show(); |
| 949 | RedrawHierarchyView(); |
| 950 | } |
| 951 | return; |
| 952 | |
| 953 | default: |
nothing calls this directly
no test coverage detected