Skip to content

Commit

Permalink
[Imp] Tuning Dialog: Make the dialog resizable, and reduce the tuning…
Browse files Browse the repository at this point in the history
… list width (which can now be increased if it's too narrow by resizing the dialog).

[Imp] Tuning Dialog: Add mnenomics to controls.

git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@22029 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
sagamusix committed Oct 28, 2024
1 parent 17cee9c commit 8102b26
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 38 deletions.
10 changes: 5 additions & 5 deletions mptrack/TuningDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ using NOTEINDEXTYPE = Tuning::NOTEINDEXTYPE;

// CTuningDialog dialog
CTuningDialog::CTuningDialog(CWnd* pParent, INSTRUMENTINDEX inst, CSoundFile &csf)
: DialogBase(IDD_TUNING, pParent)
: ResizableDialog(IDD_TUNING, pParent)
, m_sndFile(csf)
, m_TreeCtrlTuning(this)
, m_TreeItemTuningItemMap(s_notFoundItemTree, s_notFoundItemTuning)
Expand Down Expand Up @@ -152,7 +152,7 @@ void CTuningDialog::DeleteTreeItem(CTuningCollection* pTC)

BOOL CTuningDialog::OnInitDialog()
{
DialogBase::OnInitDialog();
ResizableDialog::OnInitDialog();

m_EditRatioPeriod.SubclassDlgItem(IDC_EDIT_RATIOPERIOD, this);
m_EditRatio.SubclassDlgItem(IDC_EDIT_RATIOVALUE, this);
Expand Down Expand Up @@ -348,7 +348,7 @@ void CTuningDialog::UpdateView(const int updateMask)

void CTuningDialog::DoDataExchange(CDataExchange* pDX)
{
DialogBase::DoDataExchange(pDX);
ResizableDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_STATICRATIOMAP, m_RatioMapWnd);
DDX_Control(pDX, IDC_COMBO_TTYPE, m_CombobTuningType);
DDX_Control(pDX, IDC_EDIT_STEPS, m_EditSteps);
Expand All @@ -366,7 +366,7 @@ void CTuningDialog::DoDataExchange(CDataExchange* pDX)



BEGIN_MESSAGE_MAP(CTuningDialog, DialogBase)
BEGIN_MESSAGE_MAP(CTuningDialog, ResizableDialog)
ON_EN_CHANGE(IDC_EDIT_STEPS, &CTuningDialog::OnEnChangeEditSteps)
ON_EN_CHANGE(IDC_EDIT_RATIOPERIOD, &CTuningDialog::OnEnChangeEditRatioperiod)
ON_EN_CHANGE(IDC_EDIT_NOTENAME, &CTuningDialog::OnEnChangeEditNotename)
Expand Down Expand Up @@ -1452,7 +1452,7 @@ void CTuningDialog::OnOK()
if(GetKeyState(VK_RETURN) <= -127 && GetFocus() != GetDlgItem(IDOK))
return;
else
DialogBase::OnOK();
ResizableDialog::OnOK();
}


Expand Down
4 changes: 2 additions & 2 deletions mptrack/TuningDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "openmpt/all/BuildSettings.hpp"

#include "CDecimalSupport.h"
#include "DialogBase.h"
#include "ResizableDialog.h"
#include "tuningcollection.h"
#include "tuningRatioMapWnd.h"

Expand Down Expand Up @@ -187,7 +187,7 @@ class CTuningTreeItem

// CTuningDialog dialog

class CTuningDialog : public DialogBase
class CTuningDialog : public ResizableDialog
{
friend class CTuningTreeCtrl;

Expand Down
89 changes: 58 additions & 31 deletions mptrack/mptrack.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3378,39 +3378,39 @@ BEGIN
GROUPBOX "Current Mapping",IDC_STATIC,5,5,391,91
END

IDD_TUNING DIALOGEX 0, 0, 537, 231
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
IDD_TUNING DIALOGEX 0, 0, 495, 231
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_CONTROLPARENT
CAPTION "Tuning Properties"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_TREE_TUNING,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,6,5,252,199
PUSHBUTTON "New...",IDC_BUTTON_TUNING_NEW,6,210,48,14
PUSHBUTTON "Load...",IDC_BUTTON_IMPORT,60,210,48,14
PUSHBUTTON "Save As...",IDC_BUTTON_EXPORT,114,210,48,14
PUSHBUTTON "Remove",IDC_BUTTON_TUNING_REMOVE,168,210,48,14
GROUPBOX "Tuning",IDC_STATIC,264,6,264,198
LTEXT "Name:",IDC_STATIC,270,20,24,10
EDITTEXT IDC_EDIT_NAME,300,18,222,12,ES_AUTOHSCROLL | ES_READONLY
LTEXT "Tuning Type:",IDC_STATIC,270,36,46,14,SS_CENTERIMAGE
COMBOBOX IDC_COMBO_TTYPE,270,54,90,45,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Group Size:",IDC_STATIC,270,80,60,8,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_STEPS,330,78,30,12,ES_AUTOHSCROLL | ES_READONLY
LTEXT "Group Ratio:",IDC_STATIC,270,97,60,9,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_RATIOPERIOD,330,96,30,12,ES_AUTOHSCROLL | ES_READONLY
LTEXT "Finetune Steps:",IDC_STATIC,270,116,60,8,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_FINETUNESTEPS,330,115,30,12,ES_AUTOHSCROLL
LTEXT "Multiply all ratios by",IDC_STATIC,276,150,66,12,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_MISC_ACTIONS,276,168,42,13,ES_AUTOHSCROLL
PUSHBUTTON "Apply",IDC_BUTTON_SETVALUES,324,168,36,12
CONTROL "",IDC_STATICRATIOMAP,"Static",SS_GRAYRECT | SS_NOTIFY | WS_TABSTOP,366,48,156,132,WS_EX_CLIENTEDGE
CTEXT "Note",IDC_STATIC,372,36,30,8,SS_CENTERIMAGE
CTEXT "Name",IDC_STATIC,408,36,36,8,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_NOTENAME,408,186,30,12,ES_AUTOHSCROLL | ES_WANTRETURN
CTEXT "Ratio",IDC_STATIC,444,36,36,8,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_RATIOVALUE,444,186,42,12,ES_AUTOHSCROLL | ES_WANTRETURN
CTEXT "Cents",IDC_STATIC,486,36,30,8,SS_CENTERIMAGE
DEFPUSHBUTTON "OK",IDOK,480,210,48,14
CONTROL "",IDC_TREE_TUNING,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,6,5,210,199
PUSHBUTTON "&New...",IDC_BUTTON_TUNING_NEW,6,210,48,14
PUSHBUTTON "&Load...",IDC_BUTTON_IMPORT,60,210,48,14
PUSHBUTTON "Save &As...",IDC_BUTTON_EXPORT,114,210,48,14
PUSHBUTTON "&Remove",IDC_BUTTON_TUNING_REMOVE,168,210,48,14
GROUPBOX "Tuning",IDC_STATIC,222,6,264,198
LTEXT "Name:",IDC_STATIC,228,20,24,10
EDITTEXT IDC_EDIT_NAME,258,18,222,12,ES_AUTOHSCROLL | ES_READONLY
LTEXT "&Tuning Type:",IDC_STATIC,228,36,46,14,SS_CENTERIMAGE
COMBOBOX IDC_COMBO_TTYPE,228,54,90,45,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Group Si&ze:",IDC_STATIC,228,80,60,8,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_STEPS,288,78,30,12,ES_AUTOHSCROLL | ES_READONLY
LTEXT "&Group Ratio:",IDC_STATIC,228,97,60,9,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_RATIOPERIOD,288,96,30,12,ES_AUTOHSCROLL | ES_READONLY
LTEXT "&Finetune Steps:",IDC_STATIC,228,116,60,8,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_FINETUNESTEPS,288,115,30,12,ES_AUTOHSCROLL
LTEXT "&Multiply all ratios by",IDC_STATIC,234,150,66,12,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_MISC_ACTIONS,234,168,42,13,ES_AUTOHSCROLL
PUSHBUTTON "A&pply",IDC_BUTTON_SETVALUES,282,168,36,12
CONTROL "",IDC_STATICRATIOMAP,"Static",SS_GRAYRECT | SS_NOTIFY | WS_TABSTOP,324,48,156,132,WS_EX_CLIENTEDGE
CTEXT "Note",IDC_STATIC,330,36,30,8,SS_CENTERIMAGE
CTEXT "Name",IDC_STATIC,366,36,36,8,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_NOTENAME,366,186,30,12,ES_AUTOHSCROLL | ES_WANTRETURN
CTEXT "Ratio",IDC_STATIC,402,36,36,8,SS_CENTERIMAGE
EDITTEXT IDC_EDIT_RATIOVALUE,402,186,42,12,ES_AUTOHSCROLL | ES_WANTRETURN
CTEXT "Cents",IDC_STATIC,444,36,30,8,SS_CENTERIMAGE
DEFPUSHBUTTON "&OK",IDOK,438,210,48,14
END

IDD_CHANNELMANAGER DIALOGEX 0, 0, 524, 116
Expand Down Expand Up @@ -3510,7 +3510,7 @@ BEGIN

IDD_TUNING, DIALOG
BEGIN
RIGHTMARGIN, 524
RIGHTMARGIN, 482
VERTGUIDE, 101
VERTGUIDE, 104
VERTGUIDE, 109
Expand Down Expand Up @@ -3569,7 +3569,34 @@ END

IDD_TUNING AFX_DIALOG_LAYOUT
BEGIN
0
0,
0, 0, 100, 100,
0, 100, 0, 0,
0, 100, 0, 0,
0, 100, 0, 0,
0, 100, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 0, 0, 0,
100, 100, 0, 0
END

IDD_CHANNELMANAGER AFX_DIALOG_LAYOUT
Expand Down

0 comments on commit 8102b26

Please sign in to comment.