mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
The overlapping checkboxes problem described in #5494 is the result of the checkbox list item height being slightly too small. A fix for this, which requires a subclass of `CCheckListBox`, is described in the following StackOverflow article: https://stackoverflow.com/questions/3147958/mfc-cchecklistbox-items-overlap It turns out there is already a subclass of `CCheckListBox` in the codebase: `ShipCheckListBox`, a class that was apparently left on the cutting room floor when DaveB refactored the team loadout dialog on 2/23/99. It allows an entire selected range of items to be toggled by pressing the spacebar. I've augmented it with the StackOverflow fix, and I've added it to the team loadout dialog as well as some other places that could benefit from it. Fixes the other half of #5494.
61 lines
1.2 KiB
C++
61 lines
1.2 KiB
C++
/*
|
|
* Created by Ian "Goober5000" Warfield for the FreeSpace2 Source Code Project.
|
|
* You may not sell or otherwise commercially exploit the source or things you
|
|
* create based on the source.
|
|
*/
|
|
|
|
|
|
|
|
#include "model/model.h"
|
|
#include "parse/parselo.h"
|
|
#include "shipchecklistbox.h"
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// restrict_paths dialog
|
|
|
|
class restrict_paths : public CDialog
|
|
{
|
|
// Construction
|
|
public:
|
|
restrict_paths(CWnd* pParent = NULL); // standard constructor
|
|
|
|
// parameters for the dialog
|
|
bool m_arrival;
|
|
int m_ship_class;
|
|
int *m_path_mask;
|
|
|
|
|
|
// Dialog Data
|
|
//{{AFX_DATA(restrict_paths)
|
|
enum { IDD = IDD_RESTRICT_PATHS };
|
|
ShipCheckListBox m_path_list;
|
|
//}}AFX_DATA
|
|
|
|
|
|
// Overrides
|
|
// ClassWizard generated virtual function overrides
|
|
//{{AFX_VIRTUAL(restrict_paths)
|
|
protected:
|
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
|
//}}AFX_VIRTUAL
|
|
|
|
// Implementation
|
|
protected:
|
|
|
|
// Generated message map functions
|
|
//{{AFX_MSG(restrict_paths)
|
|
virtual BOOL OnInitDialog();
|
|
void OnCancel();
|
|
void OnOK();
|
|
//}}AFX_MSG
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
private:
|
|
// model info
|
|
polymodel *m_model;
|
|
int m_num_paths;
|
|
|
|
// regenerate all controls
|
|
void reset_controls();
|
|
};
|