2 * Copyright (c) 2002 Robert Collins.
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.
9 * A copy of the GNU General Public License can be found at
12 * Written by Robert Collins <robertc@hotmail.com>
16 #ifndef SETUP_PICKVIEW_H
17 #define SETUP_PICKVIEW_H
22 #include "RECTWrapper.h"
27 #define RTARROW_WIDTH 11
29 #define NEW_COL_SIZE_SLOP (ICON_MARGIN + SPIN_WIDTH + RTARROW_WIDTH)
32 #define CATEGORY_EXPANDED 0
33 #define CATEGORY_COLLAPSED 1
36 #include "PickCategoryLine.h"
37 #include "package_meta.h"
39 class PickView
: public Window
42 virtual bool Create (Window
* Parent
= NULL
, DWORD Style
= WS_OVERLAPPEDWINDOW
| WS_VISIBLE
| WS_CLIPCHILDREN
, RECT
* r
= NULL
);
43 virtual bool registerWindowClass ();
47 views
get_view_mode ()
51 void defaultTrust (trusts trust
);
52 void set_view_mode (views _mode
);
53 void setViewMode (PickView::views mode
);
54 void paint (HWND hwnd
);
55 LRESULT CALLBACK
list_click (HWND hwnd
, BOOL dblclk
, int x
, int y
, UINT hitCode
);
56 LRESULT CALLBACK
list_hscroll (HWND hwnd
, HWND hctl
, UINT code
, int pos
);
57 LRESULT CALLBACK
list_vscroll (HWND hwnd
, HWND hctl
, UINT code
, int pos
);
58 virtual LRESULT
WindowProc (UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
60 PickView (Category
& cat
);
61 void init(views _mode
);
63 const char *mode_caption ();
64 void insert_pkg (packagemeta
&);
65 void insert_category (Category
*, bool);
66 void clear_view (void);
67 int click (int row
, int x
);
79 HANDLE bm_spin
,bm_rtarrow
, bm_checkyes
, bm_checkno
, bm_checkna
;
82 int scroll_ulc_x
, scroll_ulc_y
;
84 PickCategoryLine contents
;
85 void scroll (HWND hwnd
, int which
, int *var
, int code
);
86 HWND
ListHeader (void) const
94 static const views Unknown
;
95 static const views PackageFull
;
96 static const views Package
;
97 static const views PackageKeeps
;
98 static const views PackageSkips
;
99 static const views Category
;
100 static const views NView
;
107 if (_value
< 0 || _value
> 5)
110 views
& operator++ ();
111 bool operator == (views
const &rhs
)
113 return _value
== rhs
._value
;
115 bool operator != (views
const &rhs
)
117 return _value
!= rhs
._value
;
119 const char *caption ();
135 static ATOM WindowClassAtom
;
139 // Stuff needed to handle resizing
141 RECTWrapper lastClientRect
;
144 void init_headers (HDC dc
);
145 void note_width (Header
*hdrs
, HDC dc
, String
const &string
, int addend
,
149 #endif /* SETUP_PICKVIEW_H */