home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WFINDDLG.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
5KB
|
159 lines
#ifndef _WFINDDLG_HPP_INCLUDED
#define _WFINDDLG_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
/*************************************************************************
*
* WFindReplaceDialog
*
* Events:
*
* FindReplace --
*
*************************************************************************/
#ifndef _WCOMDLG_HPP_INCLUDED
# include "wcomdlg.hpp"
#endif
// Styles
typedef WULong WFRDStyle;
#define WFRDSDown ((WFRDStyle)0x00000001)
#define WFRDSWholeWord ((WFRDStyle)0x00000002)
#define WFRDSMatchCase ((WFRDStyle)0x00000004)
#define WFRDSFindNext ((WFRDStyle)0x00000008)
#define WFRDSReplace ((WFRDStyle)0x00000010)
#define WFRDSReplaceAll ((WFRDStyle)0x00000020)
#define WFRDSDialogTerm ((WFRDStyle)0x00000040)
#define WFRDSShowHelp ((WFRDStyle)0x00000080)
#define WFRDSEnableHook ((WFRDStyle)0x00000100)
#define WFRDSEnableTemplate ((WFRDStyle)0x00000200)
#define WFRDSNoUpDown ((WFRDStyle)0x00000400)
#define WFRDSNoMatchCase ((WFRDStyle)0x00000800)
#define WFRDSNoWholeWord ((WFRDStyle)0x00001000)
#define WFRDSHideUpDown ((WFRDStyle)0x00004000)
#define WFRDSHideMatchCase ((WFRDStyle)0x00008000)
#define WFRDSHideWholeWord ((WFRDStyle)0x00010000)
//
// Event structure
//
struct WFindReplaceEventData : public WEventData {
WBool findNext; // if TRUE, find next only, otherwise replace
WBool searchDown; // if TRUE, search down
WBool matchCase; // if TRUE, search with case sensitivity
WBool wholeWord; // if TRUE, only consider word matches
WBool replaceAll; // if TRUE, replace all occurrences
WBool replace; // if TRUE, replace occurrence
};
//
// WFindReplaceDialog
//
class WCMCLASS WFindReplaceDialog : public WCommonDialog {
WDeclareSubclass( WFindReplaceDialog, WCommonDialog );
public:
WFindReplaceDialog();
~WFindReplaceDialog();
/*******************************************************
* Properties
*******************************************************/
// BufferSize
//
// Set/get the minimum buffer size (in bytes) being used for
// the find and replace texts. The minimum size will
// always be >= 100. Set the buffer size before you
// set the find & replace texts.
WUShort GetBufferSize() const;
WBool SetBufferSize( WUShort minSize );
// FindText
//
// The text to search for.
WString GetFindText() const;
WBool SetFindText( const WString & text );
// ReplaceText
//
// The text to replace with.
WString GetReplaceText() const;
WBool SetReplaceText( const WString & text );
// Style
//
// Set the styles used by the print dialog. Note that
// the WFRDSEnableHook style will ALWAYS be enabled.
WFRDStyle GetStyle() const;
WBool SetStyle( WFRDStyle style );
/*******************************************************
* Methods
*******************************************************/
// ChangeStyle
//
// Use to turn a specific style on or off.
WBool ChangeStyle( WFRDStyle style, WBool on );
// PromptForFind
WBool PromptForFind();
WBool PromptForFind( WWindow *owner, const WChar *title,
const WChar *findText );
// PromptForReplace
WBool PromptForReplace();
WBool PromptForReplace( WWindow *owner, const WChar *title,
const WChar *findText,
const WChar *replaceText );
/************************************************************
* Notifications
************************************************************/
void OnDialogInitialize( WWindowHandle hWnd, WWindowHandle focus );
WBool OnFRDestroy( WObject *, WEventData * );
void ProcessOwnerMessage( void *msg );
private:
void *PackFR();
WBool UnpackFR( WBool ok );
private:
void *_fr;
WUShort _minSize;
WChar *_findBuffer;
WChar *_replaceBuffer;
WUShort _findLen;
WUShort _replaceLen;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WFINDDLG_HPP_INCLUDED