MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / ResizeFrameWindow

Method ResizeFrameWindow

Source/MainFrm.cpp:706–765  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

704}
705
706void CMainFrame::ResizeFrameWindow()
707{
708 // Called when the number of channels has changed
709 ASSERT(m_pFrameEditor != NULL);
710
711 if (HasDocument()) { // // //
712 int Channels = GetTrackerView()->GetSongView()->GetChannelOrder().GetChannelCount(); // // //
713 int Height = 0, Width = 0;
714
715 // Located to the right
716 if (m_iFrameEditorPos == frame_edit_pos_t::Top) {
717 // Frame editor window
718 Height = CFrameEditor::DEFAULT_HEIGHT; // // // 050B
719 Width = m_pFrameEditor->CalcWidth(Channels);
720
721 m_pFrameEditor->MoveWindow(DPI::Rect(12, 12, Width, Height)); // // //
722
723 // Move frame controls
724 m_wndFrameControls.MoveWindow(DPI::Rect(10, Height + 21, 150, 26)); // // //
725 }
726 // Located to the left
727 else {
728 // Frame editor window
729 CRect rect;
730 m_wndVerticalControlBar.GetClientRect(&rect);
731
732 Height = rect.Height() - DPI::SY(CPatternEditor::HEADER_HEIGHT - 2); // // //
733 Width = m_pFrameEditor->CalcWidth(Channels);
734
735 m_pFrameEditor->MoveWindow(DPI::SX(2), DPI::SY(CPatternEditor::HEADER_HEIGHT + 1), DPI::SX(Width), Height); // // //
736
737 // Move frame controls
738 m_wndFrameControls.MoveWindow(DPI::Rect(4, 10, 150, 26));
739 }
740
741 // Vertical control bar
742 m_wndVerticalControlBar.m_sizeDefault.cx = DPI::SX(Width + 4); // // // 050B
743 m_wndVerticalControlBar.CalcFixedLayout(TRUE, FALSE);
744 RecalcLayout();
745 }
746
747
748 int DialogStartPos = 0;
749 if (m_iFrameEditorPos == frame_edit_pos_t::Top) {
750 CRect FrameEditorRect;
751 m_pFrameEditor->GetClientRect(&FrameEditorRect);
752 DialogStartPos = FrameEditorRect.right + DPI::SX(32); // // // 050B
753 }
754
755 CRect ParentRect;
756 m_wndControlBar.GetClientRect(&ParentRect);
757 m_wndDialogBar.MoveWindow(DialogStartPos, DPI::SY(2), ParentRect.Width() - DialogStartPos, ParentRect.Height() - DPI::SY(4)); // // //
758
759 CRect ControlRect; // // //
760 m_wndDialogBar.GetDlgItem(IDC_MAINFRAME_INST_TOOLBAR)->GetWindowRect(&ControlRect);
761 GetDesktopWindow()->MapWindowPoints(&m_wndDialogBar, ControlRect);
762 m_wndInstToolBarWnd.MoveWindow(ControlRect);
763

Callers 2

OnInitialUpdateMethod · 0.80
OnUpdateMethod · 0.80

Calls 3

GetSongViewMethod · 0.80
CalcWidthMethod · 0.80
GetChannelCountMethod · 0.45

Tested by

no test coverage detected