forked from m0nkeykong/MethodsInSE_graphicSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CheckList.h
19 lines (18 loc) · 917 Bytes
/
CheckList.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//Authors: Haim Elbaz ~ Roni Polisanov ~ Reut Leib
#pragma once
#include "Control.h"
//checklist class
class CheckList : public Control {
protected:
vector<string> options; //options
vector<size_t> checked; //mark to mark as checked
public:
CheckList(int, int, vector<string>); //constructor
vector<size_t> GetSelectedIndices() { return this->checked; } //get selected items
bool canGetFocus() { return true; } //this control can get focus
void draw(Graphics, int, int, size_t); //draw method
void keyDown(int, char); //handle keypress
void mousePressed(int, int, DWORD); //handle mouse press
void SelectIndex(size_t index) { this->checked[index] = 1; } //set selected index
void DeselectIndex(size_t index) { this->checked[index] = 0; } //deselect index
};