Patch level : 4.0
Files correlati : xvaga.cpp Ricompilazione Demo : [ ] Commento : Spiezzato in due il file xvaga.cpp: ora esiste anche xvtwin.* Nel nuovo file sono confluite tutte le funzioni di creazione/gestione di finestre (top level windows) e controlli (child windows) Aggiunta gestione alberi (wxTreeCtrl) git-svn-id: svn://10.65.10.50/trunk@15858 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8fb5c7aadc
commit
b28ce7479c
1552
xvaga/xvaga.cpp
1552
xvaga/xvaga.cpp
File diff suppressed because it is too large
Load Diff
@ -1,91 +0,0 @@
|
|||||||
#ifndef __XVINTERN_H
|
|
||||||
#define __XVINTERN_H
|
|
||||||
|
|
||||||
class TFontId
|
|
||||||
{
|
|
||||||
wxString m_strFace;
|
|
||||||
int m_nSize;
|
|
||||||
XVT_FONT_STYLE_MASK m_wMask;
|
|
||||||
WINDOW m_win;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void Copy(const TFontId& pFont);
|
|
||||||
bool IsEqual(const TFontId& pFont) const;
|
|
||||||
|
|
||||||
public:
|
|
||||||
void SetWin(WINDOW w) { m_win = w; }
|
|
||||||
WINDOW Win() const { return m_win; }
|
|
||||||
|
|
||||||
void SetPointSize(int s) { m_nSize = s; }
|
|
||||||
int PointSize() const { return m_nSize; }
|
|
||||||
|
|
||||||
void SetMask(XVT_FONT_STYLE_MASK mask) { m_wMask = mask; }
|
|
||||||
XVT_FONT_STYLE_MASK Mask() const { return m_wMask; }
|
|
||||||
int Style() const;
|
|
||||||
bool Underline() const;
|
|
||||||
int Weight() const;
|
|
||||||
|
|
||||||
void SetFaceName(const char* f) { m_strFace = f; }
|
|
||||||
const char* FaceName() const;
|
|
||||||
int Family() const;
|
|
||||||
|
|
||||||
void Copy(const wxFont& rFont);
|
|
||||||
wxFont& Font(wxDC* dc, WINDOW w) const;
|
|
||||||
|
|
||||||
TFontId& operator=(const TFontId& f) { Copy(f); return *this; }
|
|
||||||
bool operator==(const TFontId& f) const { return IsEqual(f); }
|
|
||||||
bool operator!=(const TFontId& f) const { return !IsEqual(f); }
|
|
||||||
|
|
||||||
TFontId() : m_nSize(0), m_wMask(0), m_win(NULL_WIN) { }
|
|
||||||
TFontId(const TFontId& f) : m_win(NULL_WIN) { Copy(f); }
|
|
||||||
};
|
|
||||||
|
|
||||||
class TDC : public wxObject
|
|
||||||
{
|
|
||||||
wxWindow* _owner;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
wxDC* _dc;
|
|
||||||
RCT _clip;
|
|
||||||
int _dirty; // false = 0, true = 1, very_dirty = -1;
|
|
||||||
int _deltaf;
|
|
||||||
|
|
||||||
DRAW_CTOOLS _real_dct;
|
|
||||||
TFontId _real_font;
|
|
||||||
|
|
||||||
bool PenChanged() const;
|
|
||||||
bool BrushChanged() const;
|
|
||||||
bool FontChanged() const;
|
|
||||||
|
|
||||||
public:
|
|
||||||
DRAW_CTOOLS _dct;
|
|
||||||
TFontId _font;
|
|
||||||
wxPoint _pnt;
|
|
||||||
|
|
||||||
void SetClippingBox(const RCT* pRct);
|
|
||||||
bool GetClippingBox(RCT* pRct) const;
|
|
||||||
void SetDirty(int d = 1);
|
|
||||||
int GetFontDelta() const { return _deltaf; }
|
|
||||||
|
|
||||||
virtual wxDC& GetDC(bool bPaint = false);
|
|
||||||
virtual void KillDC();
|
|
||||||
TDC(wxWindow* owner);
|
|
||||||
virtual ~TDC();
|
|
||||||
};
|
|
||||||
|
|
||||||
class TPrintDC : public TDC
|
|
||||||
{
|
|
||||||
static bool _page_start;
|
|
||||||
|
|
||||||
public:
|
|
||||||
static void SetPageStart();
|
|
||||||
|
|
||||||
virtual wxDC& GetDC(bool);
|
|
||||||
virtual void KillDC();
|
|
||||||
TPrintDC(wxWindow* owner);
|
|
||||||
virtual ~TPrintDC();
|
|
||||||
};
|
|
||||||
|
|
||||||
const wxString& _GetAppTitle();
|
|
||||||
|
|
||||||
#endif
|
|
50
xvaga/xvt.h
50
xvaga/xvt.h
@ -173,13 +173,15 @@ XVTDLL long xvt_fsys_get_file_attr(const FILE_SPEC *fs, long attr); // Place
|
|||||||
// Added by Guy
|
// Added by Guy
|
||||||
XVTDLL unsigned long xvt_fsys_get_disk_size(const char* path, char unit);
|
XVTDLL unsigned long xvt_fsys_get_disk_size(const char* path, char unit);
|
||||||
XVTDLL unsigned long xvt_fsys_get_disk_free_space(const char* path, char unit);
|
XVTDLL unsigned long xvt_fsys_get_disk_free_space(const char* path, char unit);
|
||||||
|
XVTDLL BOOLEAN xvt_fsys_is_floppy_drive(const char* path);
|
||||||
XVTDLL BOOLEAN xvt_fsys_is_removable_drive(const char* path);
|
XVTDLL BOOLEAN xvt_fsys_is_removable_drive(const char* path);
|
||||||
XVTDLL BOOLEAN xvt_fsys_is_network_drive(const char* path);
|
XVTDLL BOOLEAN xvt_fsys_is_network_drive(const char* path);
|
||||||
XVTDLL BOOLEAN xvt_fsys_is_fixed_drive(const char* path);
|
XVTDLL BOOLEAN xvt_fsys_is_fixed_drive(const char* path);
|
||||||
XVTDLL BOOLEAN xvt_fsys_test_disk_free_space(const char* path, unsigned long filesize);
|
XVTDLL BOOLEAN xvt_fsys_test_disk_free_space(const char* path, unsigned long filesize);
|
||||||
XVTDLL BOOLEAN xvt_fsys_mkdir(const char *pathname);
|
XVTDLL BOOLEAN xvt_fsys_mkdir(const char *pathname);
|
||||||
XVTDLL BOOLEAN xvt_fsys_rmdir(const char *pathname);
|
XVTDLL BOOLEAN xvt_fsys_rmdir(const char *pathname);
|
||||||
XVTDLL BOOLEAN xvt_fsys_removefile(const char *pathname);
|
XVTDLL BOOLEAN xvt_fsys_removefile(const char *pathname); // DEPRECATED!
|
||||||
|
XVTDLL BOOLEAN xvt_fsys_remove_file(const char *pathname);
|
||||||
XVTDLL int xvt_fsys_access(const char *pathname, int mode);
|
XVTDLL int xvt_fsys_access(const char *pathname, int mode);
|
||||||
XVTDLL BOOLEAN xvt_fsys_file_exists(const char *pathname);
|
XVTDLL BOOLEAN xvt_fsys_file_exists(const char *pathname);
|
||||||
XVTDLL int xvt_fsys_get_campo_stp_value(const char* name, char* value, int valsize);
|
XVTDLL int xvt_fsys_get_campo_stp_value(const char* name, char* value, int valsize);
|
||||||
@ -219,6 +221,21 @@ XVTDLL void xvt_menu_set_item_enabled(WINDOW win, MENU_TAG tag, BOOLEAN e
|
|||||||
XVTDLL void xvt_menu_set_item_title(WINDOW win, MENU_TAG tag, const char* text);
|
XVTDLL void xvt_menu_set_item_title(WINDOW win, MENU_TAG tag, const char* text);
|
||||||
XVTDLL void xvt_menu_set_tree(WINDOW win, MENU_ITEM* tree);
|
XVTDLL void xvt_menu_set_tree(WINDOW win, MENU_ITEM* tree);
|
||||||
XVTDLL void xvt_menu_update(WINDOW win);
|
XVTDLL void xvt_menu_update(WINDOW win);
|
||||||
|
XVTDLL MENU_ITEM* xvt_menu_duplicate_tree(const MENU_ITEM* m);
|
||||||
|
|
||||||
|
|
||||||
|
XVTDLL void xvt_notebk_add_page(WINDOW notebk, short tab_no, short page_no,
|
||||||
|
const char* title, long page_data);
|
||||||
|
XVTDLL void xvt_notebk_add_tab(WINDOW notebk, short tab_no, const char* title, XVT_IMAGE image);
|
||||||
|
XVTDLL WINDOW xvt_notebk_create_face(WINDOW notebk, short tab_no, short page_no,
|
||||||
|
EVENT_MASK mask, EVENT_HANDLER face_eh, long app_data);
|
||||||
|
XVTDLL WINDOW xvt_notebk_create_face_def(WINDOW notebk, short tab_no, short page_no,
|
||||||
|
WIN_DEF* win_def_p, EVENT_MASK mask,
|
||||||
|
EVENT_HANDLER face_eh, long app_data);
|
||||||
|
XVTDLL WINDOW xvt_notebk_get_face(WINDOW notebk, short tab_no, short page_no);
|
||||||
|
XVTDLL short xvt_notebk_get_num_tabs(WINDOW notebk);
|
||||||
|
XVTDLL void xvt_notebk_set_front_page(WINDOW notebk, short tab_no, short page_no);
|
||||||
|
XVTDLL void xvt_notebk_set_tab_title(WINDOW notebk, short tab_no, const char* title);
|
||||||
|
|
||||||
// Added by Guy
|
// Added by Guy
|
||||||
typedef const char* TRANSLATE_CALLBACK(const char* ita);
|
typedef const char* TRANSLATE_CALLBACK(const char* ita);
|
||||||
@ -301,6 +318,29 @@ XVTDLL double xvt_str_fuzzy_compare (const char* s1, const char* s2);
|
|||||||
XVTDLL void xvt_str_make_upper(char* str);
|
XVTDLL void xvt_str_make_upper(char* str);
|
||||||
XVTDLL void xvt_str_make_lower(char* str);
|
XVTDLL void xvt_str_make_lower(char* str);
|
||||||
|
|
||||||
|
XVTDLL XVT_TREEVIEW_NODE xvt_treeview_add_child_node(WINDOW win,
|
||||||
|
XVT_TREEVIEW_NODE parent, XVT_TREEVIEW_NODE_TYPE type,
|
||||||
|
XVT_IMAGE item_image, XVT_IMAGE collapsed_image, XVT_IMAGE expanded_image,
|
||||||
|
const char* string, XVT_TREEVIEW_CALLBACK callback, const char* data);
|
||||||
|
XVTDLL WINDOW xvt_treeview_create(WINDOW parent_win,
|
||||||
|
RCT * rct_p, char * title, long ctl_flags, long app_data, int ctl_id,
|
||||||
|
XVT_IMAGE item_image, XVT_IMAGE collapsed_image, XVT_IMAGE expanded_image,
|
||||||
|
long attrs, int line_height);
|
||||||
|
XVTDLL void xvt_treeview_destroy_node(WINDOW win, XVT_TREEVIEW_NODE node);
|
||||||
|
XVTDLL BOOLEAN xvt_treeview_expand_node(WINDOW win, XVT_TREEVIEW_NODE node, BOOLEAN recurse);
|
||||||
|
XVTDLL XVT_TREEVIEW_NODE xvt_treeview_get_child_node(WINDOW win, XVT_TREEVIEW_NODE parent_node, int position);
|
||||||
|
XVTDLL const char* xvt_treeview_get_node_data(WINDOW win, XVT_TREEVIEW_NODE node);
|
||||||
|
XVTDLL XVT_TREEVIEW_NODE xvt_treeview_get_root_node(WINDOW win);
|
||||||
|
XVTDLL XVT_TREEVIEW_NODE xvt_treeview_get_selected_node(WINDOW win);
|
||||||
|
XVTDLL BOOLEAN xvt_treeview_remove_child_node(WINDOW win, XVT_TREEVIEW_NODE node);
|
||||||
|
XVTDLL BOOLEAN xvt_treeview_remove_node_children(WINDOW win, XVT_TREEVIEW_NODE node);
|
||||||
|
XVTDLL void xvt_treeview_resume(WINDOW win);
|
||||||
|
XVTDLL void xvt_treeview_select_node(WINDOW win, XVT_TREEVIEW_NODE node, BOOLEAN sel);
|
||||||
|
XVTDLL void xvt_treeview_set_node_images(WINDOW win, XVT_TREEVIEW_NODE node,
|
||||||
|
XVT_IMAGE item_image, XVT_IMAGE collapsed_image, XVT_IMAGE expanded_image);
|
||||||
|
XVTDLL void xvt_treeview_set_node_string(WINDOW win, XVT_TREEVIEW_NODE node, const char* text);
|
||||||
|
XVTDLL void xvt_treeview_suspend(WINDOW win);
|
||||||
|
|
||||||
XVTDLL BOOLEAN xvt_chr_is_digit(int c);
|
XVTDLL BOOLEAN xvt_chr_is_digit(int c);
|
||||||
XVTDLL BOOLEAN xvt_chr_is_alpha(int c);
|
XVTDLL BOOLEAN xvt_chr_is_alpha(int c);
|
||||||
XVTDLL BOOLEAN xvt_chr_is_alnum(int c);
|
XVTDLL BOOLEAN xvt_chr_is_alnum(int c);
|
||||||
@ -328,6 +368,7 @@ XVTDLL void xvt_sys_sleep(unsigned long msec);
|
|||||||
XVTDLL BOOLEAN xvt_sys_test_network_version();
|
XVTDLL BOOLEAN xvt_sys_test_network_version();
|
||||||
XVTDLL void xvt_sys_searchenv(const char *filename, const char *varname, char *pathname);
|
XVTDLL void xvt_sys_searchenv(const char *filename, const char *varname, char *pathname);
|
||||||
XVTDLL void xvt_sys_sorry_box(const char * file, int line);
|
XVTDLL void xvt_sys_sorry_box(const char * file, int line);
|
||||||
|
XVTDLL void xvt_sys_deprecated_box(const char * file, int line);
|
||||||
XVTDLL long xvt_timer_create(WINDOW win, long interval);
|
XVTDLL long xvt_timer_create(WINDOW win, long interval);
|
||||||
XVTDLL void xvt_timer_destroy(long id);
|
XVTDLL void xvt_timer_destroy(long id);
|
||||||
XVTDLL void xvt_vobj_destroy(WINDOW win);
|
XVTDLL void xvt_vobj_destroy(WINDOW win);
|
||||||
@ -370,6 +411,7 @@ XVTDLL ULONG xvt_odbc_execute(XVT_ODBC handle, const char* sql, ODBC_CALLBACK cb
|
|||||||
XVTDLL BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn,
|
XVTDLL BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn,
|
||||||
const char* subject, const char* msg, const char* attach, BOOLEAN ui);
|
const char* subject, const char* msg, const char* attach, BOOLEAN ui);
|
||||||
|
|
||||||
|
XVTDLL void xvt_btn_set_images(WINDOW win, XVT_IMAGE up, XVT_IMAGE down);
|
||||||
XVTDLL int xvt_net_get_status();
|
XVTDLL int xvt_net_get_status();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -378,4 +420,10 @@ XVTDLL int xvt_net_get_status();
|
|||||||
|
|
||||||
#define SORRY_BOX() xvt_sys_sorry_box(__FILE__, __LINE__)
|
#define SORRY_BOX() xvt_sys_sorry_box(__FILE__, __LINE__)
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
#define DEPRECATED_BOX() xvt_sys_deprecated_box(__FILE__, __LINE__)
|
||||||
|
#else
|
||||||
|
#define DEPRECATED_BOX()
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -1,3 +1,5 @@
|
|||||||
|
#define XVT_CC_ENUM_END 127
|
||||||
|
|
||||||
#define XVT_OS_WIN32 400
|
#define XVT_OS_WIN32 400
|
||||||
#define XVT_OS_LINUX 595
|
#define XVT_OS_LINUX 595
|
||||||
|
|
||||||
@ -15,6 +17,7 @@
|
|||||||
#define XVT_WS_WIN_2000 412
|
#define XVT_WS_WIN_2000 412
|
||||||
#define XVT_WS_WIN_XP 413
|
#define XVT_WS_WIN_XP 413
|
||||||
#define XVT_WS_WIN_SERVER 414
|
#define XVT_WS_WIN_SERVER 414
|
||||||
|
#define XVT_WS_WIN_VISTA 415
|
||||||
|
|
||||||
#define XVT_WS_UNKNOWN 0
|
#define XVT_WS_UNKNOWN 0
|
||||||
#define MACWS 100 /* Apple Macintosh */
|
#define MACWS 100 /* Apple Macintosh */
|
||||||
@ -53,3 +56,17 @@
|
|||||||
#define ATTR_WIN_OPENFILENAME_HOOK (ATTR_WIN_BASE + 13)
|
#define ATTR_WIN_OPENFILENAME_HOOK (ATTR_WIN_BASE + 13)
|
||||||
#define ATTR_WIN_POPUP_DETACHED (ATTR_WIN_BASE + 14)
|
#define ATTR_WIN_POPUP_DETACHED (ATTR_WIN_BASE + 14)
|
||||||
#define main xvt_main
|
#define main xvt_main
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Define Prototyping Information
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#define XVT_CC_ARGL(al__) (
|
||||||
|
#define XVT_CC_ARG(t__,a__) t__ a__,
|
||||||
|
#define XVT_CC_LARG(t__,a__) t__ a__)
|
||||||
|
#define XVT_CC_ARGS(al__) al__
|
||||||
|
#define XVT_CC_NOARGS() (void)
|
||||||
|
|
||||||
|
/* Default to no linkage conventions in callback typedef */
|
||||||
|
#define XVT_CALLCONV_TYPEDEF(ret, func, args) \
|
||||||
|
ret (* func) XVT_CC_ARGS(args)
|
||||||
|
@ -228,6 +228,9 @@ WC_ICON, /* icon control */
|
|||||||
WO_TE, /* text edit */
|
WO_TE, /* text edit */
|
||||||
WC_HGAUGE, /* horizontal progress bar */
|
WC_HGAUGE, /* horizontal progress bar */
|
||||||
WC_VGAUGE, /* vertical progress bar */
|
WC_VGAUGE, /* vertical progress bar */
|
||||||
|
WC_NOTEBK, /* notebook control */
|
||||||
|
WC_HTML, /* HTML control */
|
||||||
|
WC_TREE, /* tree view */
|
||||||
} WIN_TYPE;
|
} WIN_TYPE;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -246,6 +249,20 @@ HVGAUGE /* progress bar */
|
|||||||
|
|
||||||
} SCROLL_TYPE;
|
} SCROLL_TYPE;
|
||||||
|
|
||||||
|
/* Treeview - Types */
|
||||||
|
|
||||||
|
typedef void * XVT_TREEVIEW_NODE;
|
||||||
|
|
||||||
|
typedef enum e_treeview_node_type {
|
||||||
|
XVT_TREEVIEW_NODE_TERMINAL, /* leaf - no children */
|
||||||
|
XVT_TREEVIEW_NODE_NONTERMINAL, /* branch - may have children */
|
||||||
|
XVT_ENUM_DUMMY26 = XVT_CC_ENUM_END
|
||||||
|
} XVT_TREEVIEW_NODE_TYPE;
|
||||||
|
|
||||||
|
typedef XVT_CALLCONV_TYPEDEF( BOOLEAN, XVT_TREEVIEW_CALLBACK,
|
||||||
|
(WINDOW ctl_win, XVT_TREEVIEW_NODE node) );
|
||||||
|
|
||||||
|
|
||||||
typedef struct s_ctlinfo {
|
typedef struct s_ctlinfo {
|
||||||
|
|
||||||
WIN_TYPE type;
|
WIN_TYPE type;
|
||||||
@ -275,6 +292,27 @@ BOOLEAN focus_change;
|
|||||||
BOOLEAN active;
|
BOOLEAN active;
|
||||||
|
|
||||||
} listedit;
|
} listedit;
|
||||||
|
struct s_notebk {
|
||||||
|
|
||||||
|
WINDOW face;
|
||||||
|
short tab_no;
|
||||||
|
short page_no;
|
||||||
|
|
||||||
|
} notebk;
|
||||||
|
struct s_html {
|
||||||
|
|
||||||
|
int reserved; /* Reserved...no usage yet.*/
|
||||||
|
|
||||||
|
} html;
|
||||||
|
struct s_treeview {
|
||||||
|
|
||||||
|
XVT_TREEVIEW_NODE node; /* Node */
|
||||||
|
BOOLEAN sgl_click; /* Single click */
|
||||||
|
BOOLEAN dbl_click; /* Double click */
|
||||||
|
BOOLEAN expanded; /* Node was expanded */
|
||||||
|
BOOLEAN collapsed; /* Node was collapsed */
|
||||||
|
|
||||||
|
} treeview;
|
||||||
|
|
||||||
} v;
|
} v;
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
#include "incstr.h"
|
#include "incstr.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "xvintern.h"
|
|
||||||
#include "xvtpdf.h"
|
#include "xvtpdf.h"
|
||||||
|
#include "xvtwin.h"
|
||||||
|
|
||||||
#pragma pack(4)
|
#pragma pack(4)
|
||||||
|
|
||||||
@ -368,7 +368,6 @@ TwxPrintOutCache::~TwxPrintOutCache()
|
|||||||
// Reset(); // Essendo un oggetto statico la delete m_po non funziona!
|
// Reset(); // Essendo un oggetto statico la delete m_po non funziona!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TPrintDC
|
// TPrintDC
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user