]> cygwin.com Git - cygwin-apps/setup.git/blame - PickView.h
2002-02-19 Robert Collins <rbtcollins@hotmail.com>
[cygwin-apps/setup.git] / PickView.h
CommitLineData
97647369
RC
1/*
2 * Copyright (c) 2002 Robert Collins.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
11 *
12 * Written by Robert Collins <robertc@hotmail.com>
13 *
14 */
15
16#ifndef _PICKVIEW_H_
17#define _PICKVIEW_H_
18
19#include "win32.h"
3c054baf 20#include "String++.h"
97647369
RC
21
22#define HMARGIN 10
23#define ROW_MARGIN 5
24#define ICON_MARGIN 4
25#define RTARROW_WIDTH 11
26#define SPIN_WIDTH 11
27#define NEW_COL_SIZE_SLOP (ICON_MARGIN + SPIN_WIDTH + RTARROW_WIDTH)
28
29#define CHECK_SIZE 11
30
31class PickView;
32#include "PickCategoryLine.h"
33#include "package_meta.h"
34
35class PickView
36{
37public:
38 class views;
39 class Header;
40 int num_columns;
41 views get_view_mode ()
42 {
43 return view_mode;
44 };
45 void set_view_mode (views _mode);
46 Header *headers;
47 PickView (views mode, HWND listview, Category & cat);
48 const char *mode_caption ();
49 void insert_pkg (packagemeta &);
50 void insert_category (Category *, bool);
51 void clear_view (void);
52 int click (int row, int x);
53 int current_col;
54 int new_col;
55 int src_col;
56 int cat_col;
57 int pkg_col;
58 int last_col;
59 int row_height;
60 TEXTMETRIC tm;
61 HDC bitmap_dc;
62 HANDLE bm_spin,bm_rtarrow, bm_checkyes, bm_checkno, bm_checkna;
63 trusts deftrust;
64 HANDLE sysfont;
65 int scroll_ulc_x, scroll_ulc_y;
66 int header_height;
67 PickCategoryLine contents;
68 void scroll (HWND hwnd, int which, int *var, int code);
69 HWND ListHeader (void) const
70 {
71 return listheader;
72 }
73
74
75 class views
76 {
77 public:
78 static const views Unknown;
79 static const views PackageFull;
80 static const views Package;
81 static const views Category;
82 static const views NView;
83 views ():_value (0)
84 {
85 };
86 views (int aInt)
87 {
88 _value = aInt;
89 if (_value < 0 || _value > 3)
90 _value = 0;
91 }
92 views & operator++ ();
93 bool operator == (views const &rhs)
94 {
95 return _value == rhs._value;
96 }
97 bool operator != (views const &rhs)
98 {
99 return _value != rhs._value;
100 }
101 const char *caption ();
102
103 private:
104 int _value;
105 };
106
107 class Header
108 {
109 public:
110 const char *text;
111 int slen;
112 int width;
113 int x;
114 };
115
116private:
117 HWND listview;
118 HWND listheader;
119 views view_mode;
120 void set_headers ();
121 void init_headers (HDC dc);
3c054baf 122 void note_width (Header *hdrs, HDC dc, String const &string, int addend,
97647369
RC
123 int column);
124
125};
126
127#endif // _PICKVIEW_H_
This page took 0.033975 seconds and 5 git commands to generate.