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
b33f95e6
Commit
b33f95e6
authored
Jun 14, 2006
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleview: Added pane bar.
parent
68f590cf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
185 additions
and
2 deletions
+185
-2
Makefile.in
programs/oleview/Makefile.in
+2
-1
main.h
programs/oleview/main.h
+17
-0
oleview.c
programs/oleview/oleview.c
+7
-1
pane.c
programs/oleview/pane.c
+159
-0
No files found.
programs/oleview/Makefile.in
View file @
b33f95e6
...
...
@@ -9,7 +9,8 @@ EXTRALIBS = -luuid
EXTRADEFS
=
-DUNICODE
C_SRCS
=
\
oleview.c
oleview.c
\
pane.c
RC_SRCS
=
rsrc.rc
RC_BINSRC
=
rsrc.rc
...
...
programs/oleview/main.h
View file @
b33f95e6
...
...
@@ -29,15 +29,32 @@
#include "resource.h"
#define MAX_LOAD_STRING 256
#define MAX_WINDOW_WIDTH 30000
#define STATUS_WINDOW 2000
typedef
struct
{
HWND
hMainWnd
;
HWND
hPaneWnd
;
HWND
hStatusBar
;
HWND
hToolBar
;
HINSTANCE
hMainInst
;
}
GLOBALS
;
typedef
struct
{
HWND
left
;
HWND
right
;
INT
pos
;
INT
size
;
INT
width
;
INT
height
;
INT
last
;
}
PANE
;
extern
GLOBALS
globals
;
/* Predefinitions: */
/* pane.c */
BOOL
CreatePanedWindow
(
HWND
hWnd
,
HWND
*
hWndCreated
,
HINSTANCE
hInst
);
programs/oleview/oleview.c
View file @
b33f95e6
...
...
@@ -24,7 +24,7 @@ GLOBALS globals;
void
ResizeChild
(
void
)
{
RECT
stat
,
tool
;
RECT
client
,
stat
,
tool
;
MoveWindow
(
globals
.
hStatusBar
,
0
,
0
,
0
,
0
,
TRUE
);
MoveWindow
(
globals
.
hToolBar
,
0
,
0
,
0
,
0
,
TRUE
);
...
...
@@ -39,6 +39,10 @@ void ResizeChild(void)
tool
.
bottom
+=
2
;
}
else
tool
.
bottom
=
0
;
GetClientRect
(
globals
.
hMainWnd
,
&
client
);
MoveWindow
(
globals
.
hPaneWnd
,
0
,
tool
.
bottom
,
client
.
right
,
client
.
bottom
-
tool
.
bottom
-
stat
.
bottom
,
TRUE
);
}
void
UpdateStatusBar
(
int
itemID
)
...
...
@@ -58,6 +62,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg,
{
case
WM_CREATE
:
OleInitialize
(
NULL
);
if
(
!
CreatePanedWindow
(
hWnd
,
&
globals
.
hPaneWnd
,
globals
.
hMainInst
))
PostQuitMessage
(
0
);
break
;
case
WM_DESTROY
:
OleUninitialize
();
...
...
programs/oleview/pane.c
0 → 100644
View file @
b33f95e6
/*
* OleView (pane.c)
*
* Copyright 2006 Piotr Caban
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "main.h"
int
GetSplitPos
(
HWND
hWnd
)
{
PANE
*
pane
=
(
PANE
*
)
GetMenu
(
hWnd
);
if
(
pane
->
pos
<
pane
->
size
/
2
+
1
)
pane
->
pos
=
pane
->
size
/
2
+
1
;
return
(
pane
->
width
>
pane
->
pos
+
pane
->
size
/
2
+
1
?
pane
->
pos
:
pane
->
width
-
pane
->
size
/
2
-
1
);
}
void
DrawSplitMoving
(
HWND
hWnd
,
int
x
)
{
RECT
rt
;
HDC
hdc
=
GetDC
(
hWnd
);
PANE
*
pane
=
(
PANE
*
)
GetMenu
(
hWnd
);
GetClientRect
(
hWnd
,
&
rt
);
if
(
pane
->
last
!=-
1
)
{
rt
.
left
=
pane
->
last
-
pane
->
size
/
2
;
rt
.
right
=
pane
->
last
+
pane
->
size
/
2
;
InvertRect
(
hdc
,
&
rt
);
}
pane
->
pos
=
x
>
MAX_WINDOW_WIDTH
?
-
1
:
x
;
x
=
GetSplitPos
(
hWnd
);
pane
->
pos
=
x
;
rt
.
left
=
x
-
pane
->
size
/
2
;
rt
.
right
=
x
+
pane
->
size
/
2
;
pane
->
last
=
x
;
InvertRect
(
hdc
,
&
rt
);
ReleaseDC
(
hWnd
,
hdc
);
}
LRESULT
CALLBACK
PaneProc
(
HWND
hWnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
POINT
pt
;
PANE
*
pane
=
(
PANE
*
)
GetMenu
(
hWnd
);
switch
(
uMsg
)
{
case
WM_SETCURSOR
:
GetCursorPos
(
&
pt
);
ScreenToClient
(
hWnd
,
&
pt
);
if
(
pt
.
x
>=
GetSplitPos
(
hWnd
)
-
pane
->
size
/
2
&&
pt
.
x
<=
GetSplitPos
(
hWnd
)
+
pane
->
size
/
2
)
SetCursor
(
LoadCursor
(
0
,
IDC_SIZEWE
));
break
;
case
WM_LBUTTONDOWN
:
if
(
LOWORD
(
lParam
)
>=
GetSplitPos
(
hWnd
)
-
pane
->
size
/
2
&&
LOWORD
(
lParam
)
<=
GetSplitPos
(
hWnd
)
+
pane
->
size
/
2
)
{
pane
->
last
=
-
1
;
DrawSplitMoving
(
hWnd
,
LOWORD
(
lParam
));
SetCapture
(
hWnd
);
}
break
;
case
WM_LBUTTONUP
:
if
(
GetCapture
()
==
hWnd
)
{
pane
->
last
=
-
1
;
DrawSplitMoving
(
hWnd
,
LOWORD
(
lParam
));
MoveWindow
(
pane
->
left
,
0
,
0
,
GetSplitPos
(
hWnd
)
-
pane
->
size
/
2
,
pane
->
height
,
TRUE
);
MoveWindow
(
pane
->
right
,
GetSplitPos
(
hWnd
)
+
pane
->
size
/
2
,
0
,
pane
->
width
-
GetSplitPos
(
hWnd
)
-
pane
->
size
/
2
,
pane
->
height
,
TRUE
);
ReleaseCapture
();
}
break
;
case
WM_MOUSEMOVE
:
if
(
GetCapture
()
==
hWnd
)
DrawSplitMoving
(
hWnd
,
LOWORD
(
lParam
));
break
;
case
WM_SIZE
:
if
(
wParam
==
SIZE_MINIMIZED
)
break
;
pane
->
width
=
LOWORD
(
lParam
);
pane
->
height
=
HIWORD
(
lParam
);
MoveWindow
(
pane
->
left
,
0
,
0
,
GetSplitPos
(
hWnd
)
-
pane
->
size
/
2
,
HIWORD
(
lParam
),
TRUE
);
MoveWindow
(
pane
->
right
,
GetSplitPos
(
hWnd
)
+
pane
->
size
/
2
,
0
,
LOWORD
(
lParam
)
-
GetSplitPos
(
hWnd
)
-
pane
->
size
/
2
,
HIWORD
(
lParam
),
TRUE
);
break
;
case
WM_DESTROY
:
HeapFree
(
GetProcessHeap
(),
0
,
pane
);
break
;
default:
return
DefWindowProc
(
hWnd
,
uMsg
,
wParam
,
lParam
);
}
return
0
;
}
BOOL
CreatePanedWindow
(
HWND
hWnd
,
HWND
*
hWndCreated
,
HINSTANCE
hInst
)
{
WNDCLASS
wcc
;
const
WCHAR
wszPaneClass
[]
=
{
'P'
,
'A'
,
'N'
,
'E'
,
'\0'
};
PANE
*
pane
;
memset
(
&
wcc
,
0
,
sizeof
(
WNDCLASS
));
wcc
.
lpfnWndProc
=
PaneProc
;
wcc
.
hbrBackground
=
(
HBRUSH
)(
COLOR_WINDOW
);
wcc
.
lpszClassName
=
wszPaneClass
;
if
(
!
RegisterClass
(
&
wcc
))
return
FALSE
;
pane
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PANE
));
*
hWndCreated
=
CreateWindow
(
wszPaneClass
,
NULL
,
WS_CHILD
|
WS_VISIBLE
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
0
,
0
,
hWnd
,
(
HMENU
)
pane
,
hInst
,
NULL
);
if
(
!
hWndCreated
)
return
FALSE
;
pane
->
left
=
NULL
;
pane
->
right
=
NULL
;
pane
->
pos
=
300
;
pane
->
size
=
5
;
return
TRUE
;
}
void
SetLeft
(
HWND
hParent
,
HWND
hWnd
)
{
PANE
*
pane
=
(
PANE
*
)
GetMenu
(
hParent
);
pane
->
left
=
hWnd
;
}
void
SetRight
(
HWND
hParent
,
HWND
hWnd
)
{
PANE
*
pane
=
(
PANE
*
)
GetMenu
(
hParent
);
pane
->
right
=
hWnd
;
}
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