Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
5800539b
Commit
5800539b
authored
Jul 24, 2008
by
Owen Rudge
Committed by
Alexandre Julliard
Jul 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Add status bar to control panel.
parent
238cdf71
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
7 deletions
+64
-7
control.c
dlls/shell32/control.c
+63
-7
cpanel.h
dlls/shell32/cpanel.h
+1
-0
No files found.
dlls/shell32/control.c
View file @
5800539b
...
...
@@ -166,6 +166,7 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
}
#define IDC_LISTVIEW 1000
#define IDC_STATUSBAR 1001
#define NUM_COLUMNS 2
#define LISTVIEW_DEFSTYLE (WS_CHILD | WS_VISIBLE | WS_TABSTOP |\
...
...
@@ -173,18 +174,20 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
static
BOOL
Control_CreateListView
(
CPanel
*
panel
)
{
RECT
ws
;
RECT
ws
,
sb
;
WCHAR
empty_string
[]
=
{
0
};
WCHAR
buf
[
MAX_STRING_LEN
];
LVCOLUMNW
lvc
;
/* Create list view */
GetClientRect
(
panel
->
hWndStatusBar
,
&
sb
);
GetClientRect
(
panel
->
hWnd
,
&
ws
);
panel
->
hWndListView
=
CreateWindowExW
(
WS_EX_CLIENTEDGE
,
WC_LISTVIEWW
,
empty_string
,
LISTVIEW_DEFSTYLE
|
LVS_ICON
,
0
,
0
,
ws
.
right
-
ws
.
left
,
ws
.
bottom
-
ws
.
top
,
panel
->
hWnd
,
(
HMENU
)
IDC_LISTVIEW
,
panel
->
hInst
,
NULL
);
0
,
0
,
ws
.
right
-
ws
.
left
,
ws
.
bottom
-
ws
.
top
-
(
sb
.
bottom
-
sb
.
top
),
panel
->
hWnd
,
(
HMENU
)
IDC_LISTVIEW
,
panel
->
hInst
,
NULL
);
if
(
!
panel
->
hWndListView
)
return
FALSE
;
...
...
@@ -233,15 +236,23 @@ static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW* cs)
CPlItem
*
item
;
LVITEMW
lvItem
;
INITCOMMONCONTROLSEX
icex
;
INT
sb_parts
;
SetWindowLongPtrW
(
hWnd
,
0
,
(
LONG_PTR
)
panel
);
panel
->
hWnd
=
hWnd
;
/* Initialise common control DLL */
icex
.
dwSize
=
sizeof
(
INITCOMMONCONTROLSEX
);
icex
.
dwICC
=
ICC_LISTVIEW_CLASSES
;
icex
.
dwICC
=
ICC_LISTVIEW_CLASSES
|
ICC_BAR_CLASSES
;
InitCommonControlsEx
(
&
icex
);
/* create the status bar */
if
(
!
(
panel
->
hWndStatusBar
=
CreateStatusWindowW
(
WS_CHILD
|
WS_VISIBLE
|
CCS_BOTTOM
|
SBARS_SIZEGRIP
,
NULL
,
hWnd
,
IDC_STATUSBAR
)))
return
;
sb_parts
=
-
1
;
SendMessageW
(
panel
->
hWndStatusBar
,
SB_SETPARTS
,
1
,
(
LPARAM
)
&
sb_parts
);
/* create the list view */
if
(
!
Control_CreateListView
(
panel
))
return
;
...
...
@@ -491,6 +502,17 @@ static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg,
return
0
;
}
case
LVN_ITEMCHANGED
:
{
CPlItem
*
item
=
Control_GetCPlItem_From_ListView
(
panel
);
/* update the status bar if item is valid */
if
(
item
)
SetWindowTextW
(
panel
->
hWndStatusBar
,
item
->
applet
->
info
[
item
->
id
].
szInfo
);
return
0
;
}
}
break
;
...
...
@@ -499,12 +521,46 @@ static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg,
break
;
}
case
WM_MENUSELECT
:
/* check if this is an applet */
if
((
LOWORD
(
lParam1
)
>=
IDM_CPANEL_APPLET_BASE
)
&&
(
LOWORD
(
lParam1
)
<=
IDM_CPANEL_APPLET_BASE
+
panel
->
total_subprogs
))
{
CPlItem
*
item
=
Control_GetCPlItem_From_MenuID
(
hWnd
,
LOWORD
(
lParam1
));
/* update the status bar if item is valid */
if
(
item
)
SetWindowTextW
(
panel
->
hWndStatusBar
,
item
->
applet
->
info
[
item
->
id
].
szInfo
);
}
else
SetWindowTextW
(
panel
->
hWndStatusBar
,
NULL
);
return
0
;
case
WM_SIZE
:
{
RECT
rect
;
HDWP
hdwp
;
RECT
sb
;
hdwp
=
BeginDeferWindowPos
(
2
);
if
(
hdwp
==
NULL
)
break
;
GetClientRect
(
panel
->
hWndStatusBar
,
&
sb
);
hdwp
=
DeferWindowPos
(
hdwp
,
panel
->
hWndListView
,
NULL
,
0
,
0
,
LOWORD
(
lParam2
),
HIWORD
(
lParam2
)
-
(
sb
.
bottom
-
sb
.
top
),
SWP_NOZORDER
|
SWP_NOMOVE
);
if
(
hdwp
==
NULL
)
break
;
hdwp
=
DeferWindowPos
(
hdwp
,
panel
->
hWndStatusBar
,
NULL
,
0
,
0
,
LOWORD
(
lParam2
),
LOWORD
(
lParam1
),
SWP_NOZORDER
|
SWP_NOMOVE
);
GetClientRect
(
hWnd
,
&
rect
);
MoveWindow
(
panel
->
hWndListView
,
0
,
0
,
rect
.
right
,
rect
.
bottom
,
TRUE
);
if
(
hdwp
!=
NULL
)
EndDeferWindowPos
(
hdwp
);
return
0
;
}
...
...
dlls/shell32/cpanel.h
View file @
5800539b
...
...
@@ -41,6 +41,7 @@ typedef struct CPanel {
HWND
hWndListView
;
HIMAGELIST
hImageListLarge
;
HIMAGELIST
hImageListSmall
;
HWND
hWndStatusBar
;
}
CPanel
;
/* structure to reference an individual control panel item */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment