|
Revision 644, 2.2 kB
(checked in by fujii, 3 years ago)
|
Add new netinstall source.
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
#ifndef SETUP_CONTROLADJUSTER_H |
|---|
| 18 |
#define SETUP_CONTROLADJUSTER_H |
|---|
| 19 |
|
|---|
| 20 |
#include <vector> |
|---|
| 21 |
|
|---|
| 22 |
#include "win32.h" |
|---|
| 23 |
#include "RECTWrapper.h" |
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
enum ControlPosition { |
|---|
| 33 |
CP_LEFT = 0, |
|---|
| 34 |
CP_TOP = CP_LEFT, |
|---|
| 35 |
CP_CENTERED, |
|---|
| 36 |
CP_RIGHT, |
|---|
| 37 |
CP_BOTTOM = CP_RIGHT, |
|---|
| 38 |
CP_STRETCH, |
|---|
| 39 |
}; |
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
class ControlDimension |
|---|
| 43 |
{ |
|---|
| 44 |
public: |
|---|
| 45 |
ControlDimension(long &anInt1, long &anInt2) : |
|---|
| 46 |
left(anInt1), right (anInt2){} |
|---|
| 47 |
long &left; |
|---|
| 48 |
long &right; |
|---|
| 49 |
}; |
|---|
| 50 |
|
|---|
| 51 |
class ControlAdjuster |
|---|
| 52 |
{ |
|---|
| 53 |
public: |
|---|
| 54 |
struct ControlInfo |
|---|
| 55 |
{ |
|---|
| 56 |
void adjust(HWND dlg, int widthChange, int heightChange) const; |
|---|
| 57 |
|
|---|
| 58 |
int control; |
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
ControlPosition horizontalPos; |
|---|
| 63 |
ControlPosition verticalPos; |
|---|
| 64 |
private: |
|---|
| 65 |
void adjust (ControlPosition const &how, ControlDimension &where, int by) const; |
|---|
| 66 |
}; |
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
static void AdjustControls (HWND dlg, const ControlInfo controlInfo[], |
|---|
| 74 |
int widthChange, int heightChange); |
|---|
| 75 |
}; |
|---|
| 76 |
|
|---|
| 77 |
class SizeProcessor |
|---|
| 78 |
{ |
|---|
| 79 |
typedef std::vector<const ControlAdjuster::ControlInfo*> ControlInfos; |
|---|
| 80 |
ControlInfos controlInfos; |
|---|
| 81 |
bool rectValid; |
|---|
| 82 |
RECTWrapper lastRect; |
|---|
| 83 |
public: |
|---|
| 84 |
SizeProcessor (); |
|---|
| 85 |
|
|---|
| 86 |
void AddControlInfo (const ControlAdjuster::ControlInfo* controlInfo); |
|---|
| 87 |
void UpdateSize (HWND dlg); |
|---|
| 88 |
}; |
|---|
| 89 |
|
|---|
| 90 |
#endif |
|---|