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
6056159a
Commit
6056159a
authored
Jun 16, 2003
by
Steven Edwards
Committed by
Alexandre Julliard
Jun 16, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split Win16/32 file dialogs.
parent
ae906923
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
314 additions
and
235 deletions
+314
-235
Makefile.in
dlls/commdlg/Makefile.in
+3
-2
filedlg.c
dlls/commdlg/filedlg.c
+6
-233
filedlg.h
dlls/commdlg/filedlg.h
+73
-0
filedlg16.c
dlls/commdlg/filedlg16.c
+232
-0
No files found.
dlls/commdlg/Makefile.in
View file @
6056159a
...
...
@@ -26,8 +26,9 @@ C_SRCS = \
C_SRCS16
=
\
colordlg16.c
\
fontdlg16.c
\
finddlg.c
filedlg16.c
\
finddlg.c
\
fontdlg16.c
RC_SRCS
=
rsrc.rc
...
...
dlls/commdlg/filedlg.c
View file @
6056159a
This diff is collapsed.
Click to expand it.
dlls/commdlg/filedlg.h
0 → 100644
View file @
6056159a
/*
* COMMDLG - File Dialogs
*
* Copyright 1994 Martin Ayotte
* Copyright 1996 Albrecht Kleine
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _WINE_FINDDLG_H
#define _WINE_FINDDLG_H
#define BUFFILE 512
#define BUFFILEALLOC 512 * sizeof(WCHAR)
struct
FSPRIVATE
{
HWND
hwnd
;
/* file dialog window handle */
BOOL
hook
;
/* TRUE if the dialog is hooked */
UINT
lbselchstring
;
/* registered message id */
UINT
fileokstring
;
/* registered message id */
LPARAM
lParam
;
/* save original lparam */
HANDLE16
hDlgTmpl16
;
/* handle for resource 16 */
HANDLE16
hResource16
;
/* handle for allocated resource 16 */
HANDLE16
hGlobal16
;
/* 16 bits mem block (resources) */
LPCVOID
template
;
/* template for 32 bits resource */
BOOL
open
;
/* TRUE if open dialog, FALSE if save dialog */
OPENFILENAMEW
*
ofnW
;
/* original structure or work struct */
OPENFILENAMEA
*
ofnA
;
/* original structure if 32bits ansi dialog */
OPENFILENAME16
*
ofn16
;
/* original structure if 16 bits dialog */
};
#define LFSPRIVATE struct FSPRIVATE *
#define LFS16 1
#define LFS32A 2
#define LFS32W 3
#define OFN_PROP "FILEDLG_OFN"
static
const
WCHAR
FILE_star
[]
=
{
'*'
,
'.'
,
'*'
,
0
};
static
const
WCHAR
FILE_bslash
[]
=
{
'\\'
,
0
};
static
const
WCHAR
FILE_specc
[]
=
{
'%'
,
'c'
,
':'
,
0
};
static
const
int
fldrHeight
=
16
;
static
const
int
fldrWidth
=
20
;
/* Internal Functions
* Do not Export to other applications or dlls
*/
BOOL
FILEDLG_CallWindowProc
(
LFSPRIVATE
lfs
,
UINT
wMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
LONG
FILEDLG_WMInitDialog
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
);
void
FILEDLG_MapDrawItemStruct
(
LPDRAWITEMSTRUCT16
lpdis16
,
LPDRAWITEMSTRUCT
lpdis
);
LONG
FILEDLG_WMDrawItem
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
,
int
savedlg
,
LPDRAWITEMSTRUCT
lpdis
);
LRESULT
FILEDLG_WMCommand
(
HWND
hWnd
,
LPARAM
lParam
,
UINT
notification
,
UINT
control
,
LFSPRIVATE
lfs
);
BOOL
FileDlg_Init
(
void
);
void
FILEDLG_DestroyPrivate
(
LFSPRIVATE
lfs
);
LFSPRIVATE
FILEDLG_AllocPrivate
(
LPARAM
lParam
,
int
type
,
UINT
dlgType
);
#endif
/* _WINE_FINDDLG_H */
dlls/commdlg/filedlg16.c
0 → 100644
View file @
6056159a
/*
* COMMDLG - File Dialogs
*
* Copyright 1994 Martin Ayotte
* Copyright 1996 Albrecht Kleine
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "windef.h"
#include "winnls.h"
#include "winbase.h"
#include "wingdi.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "commdlg.h"
#include "wine/debug.h"
#include "cderr.h"
#include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
commdlg
);
#include "cdlg.h"
#include "filedlg.h"
/***********************************************************************
* FILEDLG_WMMeasureItem16 [internal]
*/
static
LONG
FILEDLG_WMMeasureItem16
(
HWND16
hWnd
,
WPARAM16
wParam
,
LPARAM
lParam
)
{
LPMEASUREITEMSTRUCT16
lpmeasure
;
lpmeasure
=
MapSL
(
lParam
);
lpmeasure
->
itemHeight
=
fldrHeight
;
return
TRUE
;
}
/* ------------------ Dialog procedures ---------------------- */
/***********************************************************************
* FileOpenDlgProc (COMMDLG.6)
*/
BOOL16
CALLBACK
FileOpenDlgProc16
(
HWND16
hWnd16
,
UINT16
wMsg
,
WPARAM16
wParam
,
LPARAM
lParam
)
{
HWND
hWnd
=
HWND_32
(
hWnd16
);
LFSPRIVATE
lfs
=
(
LFSPRIVATE
)
GetPropA
(
hWnd
,
OFN_PROP
);
DRAWITEMSTRUCT
dis
;
TRACE
(
"msg=%x wparam=%x lParam=%lx
\n
"
,
wMsg
,
wParam
,
lParam
);
if
((
wMsg
!=
WM_INITDIALOG
)
&&
lfs
&&
lfs
->
hook
)
{
LRESULT
lRet
=
(
BOOL16
)
FILEDLG_CallWindowProc
(
lfs
,
wMsg
,
wParam
,
lParam
);
if
(
lRet
)
return
lRet
;
/* else continue message processing */
}
switch
(
wMsg
)
{
case
WM_INITDIALOG
:
return
FILEDLG_WMInitDialog
(
hWnd
,
wParam
,
lParam
);
case
WM_MEASUREITEM
:
return
FILEDLG_WMMeasureItem16
(
hWnd16
,
wParam
,
lParam
);
case
WM_DRAWITEM
:
FILEDLG_MapDrawItemStruct
(
MapSL
(
lParam
),
&
dis
);
return
FILEDLG_WMDrawItem
(
hWnd
,
wParam
,
lParam
,
FALSE
,
&
dis
);
case
WM_COMMAND
:
return
FILEDLG_WMCommand
(
hWnd
,
lParam
,
HIWORD
(
lParam
),
wParam
,
lfs
);
#if 0
case WM_CTLCOLOR:
SetBkColor((HDC16)wParam, 0x00C0C0C0);
switch (HIWORD(lParam))
{
case CTLCOLOR_BTN:
SetTextColor((HDC16)wParam, 0x00000000);
return hGRAYBrush;
case CTLCOLOR_STATIC:
SetTextColor((HDC16)wParam, 0x00000000);
return hGRAYBrush;
}
break;
#endif
}
return
FALSE
;
}
/***********************************************************************
* FileSaveDlgProc (COMMDLG.7)
*/
BOOL16
CALLBACK
FileSaveDlgProc16
(
HWND16
hWnd16
,
UINT16
wMsg
,
WPARAM16
wParam
,
LPARAM
lParam
)
{
HWND
hWnd
=
HWND_32
(
hWnd16
);
LFSPRIVATE
lfs
=
(
LFSPRIVATE
)
GetPropA
(
hWnd
,
OFN_PROP
);
DRAWITEMSTRUCT
dis
;
TRACE
(
"msg=%x wparam=%x lParam=%lx
\n
"
,
wMsg
,
wParam
,
lParam
);
if
((
wMsg
!=
WM_INITDIALOG
)
&&
lfs
&&
lfs
->
hook
)
{
LRESULT
lRet
;
lRet
=
(
BOOL16
)
FILEDLG_CallWindowProc
(
lfs
,
wMsg
,
wParam
,
lParam
);
if
(
lRet
)
return
lRet
;
/* else continue message processing */
}
switch
(
wMsg
)
{
case
WM_INITDIALOG
:
return
FILEDLG_WMInitDialog
(
hWnd
,
wParam
,
lParam
);
case
WM_MEASUREITEM
:
return
FILEDLG_WMMeasureItem16
(
hWnd16
,
wParam
,
lParam
);
case
WM_DRAWITEM
:
FILEDLG_MapDrawItemStruct
(
MapSL
(
lParam
),
&
dis
);
return
FILEDLG_WMDrawItem
(
hWnd
,
wParam
,
lParam
,
TRUE
,
&
dis
);
case
WM_COMMAND
:
return
FILEDLG_WMCommand
(
hWnd
,
lParam
,
HIWORD
(
lParam
),
wParam
,
lfs
);
}
/*
case WM_CTLCOLOR:
SetBkColor((HDC16)wParam, 0x00C0C0C0);
switch (HIWORD(lParam))
{
case CTLCOLOR_BTN:
SetTextColor((HDC16)wParam, 0x00000000);
return hGRAYBrush;
case CTLCOLOR_STATIC:
SetTextColor((HDC16)wParam, 0x00000000);
return hGRAYBrush;
}
return FALSE;
*/
return
FALSE
;
}
/* ------------------ APIs ---------------------- */
/***********************************************************************
* GetOpenFileName (COMMDLG.1)
*
* Creates a dialog box for the user to select a file to open.
*
* RETURNS
* TRUE on success: user selected a valid file
* FALSE on cancel, error, close or filename-does-not-fit-in-buffer.
*
* BUGS
* unknown, there are some FIXME's left.
*/
BOOL16
WINAPI
GetOpenFileName16
(
SEGPTR
ofn
/* [in/out] address of structure with data*/
)
{
HINSTANCE16
hInst
;
BOOL
bRet
=
FALSE
;
LPOPENFILENAME16
lpofn
=
MapSL
(
ofn
);
LFSPRIVATE
lfs
;
FARPROC16
ptr
;
if
(
!
lpofn
||
!
FileDlg_Init
())
return
FALSE
;
lfs
=
FILEDLG_AllocPrivate
((
LPARAM
)
ofn
,
LFS16
,
OPEN_DIALOG
);
if
(
lfs
)
{
hInst
=
GetWindowWord
(
HWND_32
(
lpofn
->
hwndOwner
),
GWL_HINSTANCE
);
ptr
=
GetProcAddress16
(
GetModuleHandle16
(
"COMMDLG"
),
(
LPCSTR
)
6
);
bRet
=
DialogBoxIndirectParam16
(
hInst
,
lfs
->
hDlgTmpl16
,
lpofn
->
hwndOwner
,
(
DLGPROC16
)
ptr
,
(
LPARAM
)
lfs
);
FILEDLG_DestroyPrivate
(
lfs
);
}
TRACE
(
"return lpstrFile='%s' !
\n
"
,
(
char
*
)
MapSL
(
lpofn
->
lpstrFile
));
return
bRet
;
}
/***********************************************************************
* GetSaveFileName (COMMDLG.2)
*
* Creates a dialog box for the user to select a file to save.
*
* RETURNS
* TRUE on success: user enters a valid file
* FALSE on cancel, error, close or filename-does-not-fit-in-buffer.
*
* BUGS
* unknown. There are some FIXME's left.
*/
BOOL16
WINAPI
GetSaveFileName16
(
SEGPTR
ofn
/* [in/out] addess of structure with data*/
)
{
HINSTANCE16
hInst
;
BOOL
bRet
=
FALSE
;
LPOPENFILENAME16
lpofn
=
MapSL
(
ofn
);
LFSPRIVATE
lfs
;
FARPROC16
ptr
;
if
(
!
lpofn
||
!
FileDlg_Init
())
return
FALSE
;
lfs
=
FILEDLG_AllocPrivate
((
LPARAM
)
ofn
,
LFS16
,
SAVE_DIALOG
);
if
(
lfs
)
{
hInst
=
GetWindowWord
(
HWND_32
(
lpofn
->
hwndOwner
),
GWL_HINSTANCE
);
ptr
=
GetProcAddress16
(
GetModuleHandle16
(
"COMMDLG"
),
(
LPCSTR
)
7
);
bRet
=
DialogBoxIndirectParam16
(
hInst
,
lfs
->
hDlgTmpl16
,
lpofn
->
hwndOwner
,
(
DLGPROC16
)
ptr
,
(
LPARAM
)
lfs
);
FILEDLG_DestroyPrivate
(
lfs
);
}
TRACE
(
"return lpstrFile='%s' !
\n
"
,
(
char
*
)
MapSL
(
lpofn
->
lpstrFile
));
return
bRet
;
}
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