GTK
- wxNotebook added - wxTabCtrl removed - added USE_WXCONFIG option - minor compile fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
cd71293400
commit
53b2867549
@ -29,6 +29,8 @@ class wxDC;
|
||||
class wxPaintDC;
|
||||
class wxMemoryDC;
|
||||
class wxToolBarGTK;
|
||||
class wxBitmapButton;
|
||||
class wxStaticBitmap;
|
||||
|
||||
class wxMask;
|
||||
class wxBitmap;
|
||||
@ -55,6 +57,8 @@ class wxMask: public wxObject
|
||||
friend wxDC;
|
||||
friend wxPaintDC;
|
||||
friend wxToolBarGTK;
|
||||
friend wxBitmapButton;
|
||||
friend wxStaticBitmap;
|
||||
|
||||
GdkBitmap *GetBitmap(void) const;
|
||||
|
||||
@ -111,6 +115,8 @@ class wxBitmap: public wxObject
|
||||
friend wxPaintDC;
|
||||
friend wxMemoryDC;
|
||||
friend wxToolBarGTK;
|
||||
friend wxBitmapButton;
|
||||
friend wxStaticBitmap;
|
||||
|
||||
GdkPixmap *GetPixmap(void) const;
|
||||
GdkBitmap *GetBitmap(void) const;
|
||||
|
107
include/wx/gtk/notebook.h
Normal file
107
include/wx/gtk/notebook.h
Normal file
@ -0,0 +1,107 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tabctrl.h
|
||||
// Purpose: wxTabCtrl class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __TABCTRLH__
|
||||
#define __TABCTRLH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "notebook.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxImageList;
|
||||
class wxPanel;
|
||||
|
||||
class wxNotebook;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxNotebook
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxNotebook: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxNotebook)
|
||||
|
||||
public:
|
||||
|
||||
wxNotebook(void);
|
||||
wxNotebook( wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = 0, const wxString& name = "notebook" );
|
||||
~wxNotebook(void);
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = 0, const wxString& name = "notebook" );
|
||||
int GetSelection(void) const;
|
||||
wxImageList* GetImageList(void) const;
|
||||
int GetPageCount(void) const;
|
||||
int GetRowCount(void) const;
|
||||
wxString GetPageText( const int page ) const;
|
||||
int GetPageImage( const int page ) const;
|
||||
void* GetPageData( const int page ) const;
|
||||
int SetSelection( const int page );
|
||||
void SetImageList( wxImageList* imageList );
|
||||
bool SetPageText( const int page, const wxString& text );
|
||||
bool SetPageImage( const int oage, const int image );
|
||||
bool SetPageData( const int page, void* data );
|
||||
void SetPageSize( const wxSize& size );
|
||||
void SetPadding( const wxSize& padding );
|
||||
bool DeleteAllPages(void);
|
||||
bool DeletePage( const int page );
|
||||
wxPanel *CreatePage( const int page, const wxString& text, const int imageId = -1, void* data = NULL );
|
||||
wxPanel *GetPanel( const int page );
|
||||
|
||||
// overriden to do nothing
|
||||
virtual void AddChild( wxWindow *win );
|
||||
|
||||
protected:
|
||||
|
||||
wxImageList* m_imageList;
|
||||
wxList m_pages;
|
||||
GtkWidget *m_frame;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTabEvent
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxTabEvent: public wxCommandEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabEvent)
|
||||
|
||||
public:
|
||||
|
||||
wxTabEvent( WXTYPE commandType = 0, int id = 0 );
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&);
|
||||
|
||||
#define EVT_TAB_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGED, \
|
||||
id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL },
|
||||
#define EVT_TAB_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGING, \
|
||||
id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL },
|
||||
|
||||
#endif
|
||||
// __TABCTRLH__
|
@ -1,539 +0,0 @@
|
||||
/* ../../include/wx/gtk/setup.h. Generated automatically by configure. */
|
||||
/* wx_setup.h
|
||||
This file is in the public domain.
|
||||
|
||||
Descriptive text for the C preprocessor macros that
|
||||
the distributed Autoconf macros can define.
|
||||
No software package will use all of them; autoheader copies the ones
|
||||
your configure.in uses into your configuration header file templates.
|
||||
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). Although this order
|
||||
can split up related entries, it makes it easier to check whether
|
||||
a given entry is in the file.
|
||||
|
||||
Leave the following blank line there!! Autoheader needs it. */
|
||||
|
||||
#ifndef __GTKSETUPH__
|
||||
#define __GTKSETUPH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
/* define the system to compile */
|
||||
#define __GTK__ 1
|
||||
#define __UNIX__ 1
|
||||
#define __LINUX__ 1
|
||||
/* #undef __SGI__ */
|
||||
/* #undef __HPUX__ */
|
||||
/* #undef __SYSV__ */
|
||||
/* #undef __SVR4__ */
|
||||
/* #undef __AIX__ */
|
||||
/* #undef __SUN__ */
|
||||
/* #undef __SOLARIS__ */
|
||||
/* #undef __SUNOS__ */
|
||||
/* #undef __ALPHA__ */
|
||||
/* #undef __OSF__ */
|
||||
/* #undef __BSD__ */
|
||||
/* #undef __FREEBSD__ */
|
||||
/* #undef __VMS__ */
|
||||
/* #undef __ULTRIX__ */
|
||||
/* #undef __DATA_GENERAL__ */
|
||||
|
||||
/*
|
||||
* Use zlib
|
||||
*/
|
||||
#define USE_ZLIB 1
|
||||
/*
|
||||
* Use gdk_imlib
|
||||
*/
|
||||
#define USE_GDK_IMLIB 1
|
||||
/*
|
||||
* Use libpng
|
||||
*/
|
||||
#define USE_LIBPNG 1
|
||||
/*
|
||||
* Use Threads
|
||||
*/
|
||||
/* #undef USE_THREADS */
|
||||
/* #undef USE_THREADS_POSIX */
|
||||
/* #undef USE_THREADS_SGI */
|
||||
/*
|
||||
* Use storable classes
|
||||
*/
|
||||
#define USE_STORABLE_CLASSES 1
|
||||
/*
|
||||
* Use automatic translation via gettext() in wxTString
|
||||
*/
|
||||
#define USE_AUTOTRANS 1
|
||||
/*
|
||||
* Use font metric files in GetTextExtent for wxPostScriptDC
|
||||
* Use consistent PostScript fonts for AFM and printing (!)
|
||||
*/
|
||||
#define USE_AFM_FOR_POSTSCRIPT 1
|
||||
#define WX_NORMALIZED_PS_FONTS 1
|
||||
/*
|
||||
* Use clipboard
|
||||
*/
|
||||
/* #undef USE_CLIPBOARD */
|
||||
/*
|
||||
* Use wxWindows layout constraint system
|
||||
*/
|
||||
#define USE_CONSTRAINTS 1
|
||||
/*
|
||||
* Use the document/view architecture
|
||||
*/
|
||||
#define USE_DOC_VIEW_ARCHITECTURE 1
|
||||
/*
|
||||
* Use enhanced dialog
|
||||
*/
|
||||
/* #undef USE_ENHANCED_DIALOG */
|
||||
/*
|
||||
* Use Form panel item placement
|
||||
*/
|
||||
/* #undef USE_FORM */
|
||||
/*
|
||||
* Use fraction class
|
||||
*/
|
||||
#define USE_FRACTION 1
|
||||
/*
|
||||
* Use gauge item
|
||||
*/
|
||||
#define USE_GAUGE 1
|
||||
/*
|
||||
* Implement a GLCanvas class as an interface to OpenGL, using the GLX
|
||||
* extension to the X11 protocol. You can use the (free) Mesa library
|
||||
* if you don't have a 'real' OpenGL.
|
||||
*/
|
||||
#define USE_GLX 0
|
||||
/*
|
||||
* Use wxWindows help facility (needs USE_IPC 1)
|
||||
*/
|
||||
/* #undef USE_HELP */
|
||||
/*
|
||||
* Use iostream.h rather than iostream
|
||||
*/
|
||||
#define USE_IOSTREAMH 1
|
||||
/*
|
||||
* Use Interprocess communication
|
||||
*/
|
||||
#define USE_IPC 1
|
||||
/*
|
||||
* Use Metafile and Metafile device context
|
||||
*/
|
||||
/* #undef USE_METAFILE */
|
||||
/*
|
||||
* Use PostScript device context
|
||||
*/
|
||||
#define USE_POSTSCRIPT 1
|
||||
/*
|
||||
* Use the print/preview architecture
|
||||
*/
|
||||
#define USE_PRINTING_ARCHITECTURE 1
|
||||
/*
|
||||
* Use Prolog IO
|
||||
*/
|
||||
/* #undef USE_PROLOGIO */
|
||||
/*
|
||||
* Use Remote Procedure Call (Needs USE_IPC and USE_PROLOGIO)
|
||||
*/
|
||||
/* #undef USE_RPC */
|
||||
/*
|
||||
* Use wxGetResource & wxWriteResource (change .Xdefaults)
|
||||
*/
|
||||
#define USE_RESOURCES 1
|
||||
/*
|
||||
* Use scrollbar item
|
||||
*/
|
||||
#define USE_SCROLLBAR 1
|
||||
/*
|
||||
* Use time and date classes
|
||||
*/
|
||||
#define USE_TIMEDATE 1
|
||||
/*
|
||||
* Use toolbar, use Xt port toolbar (3D look)
|
||||
*/
|
||||
#define USE_TOOLBAR 1
|
||||
#define USE_XT_TOOLBAR
|
||||
/*
|
||||
* Enables old type checking mechanism (wxSubType)
|
||||
*/
|
||||
/* #undef USE_TYPETREE */
|
||||
/*
|
||||
* Use virtual list box item
|
||||
*/
|
||||
/* #undef USE_VLBOX */
|
||||
/*
|
||||
* Use wxWindows resource loading (.wxr-files) (Needs USE_PROLOGIO 1)
|
||||
*/
|
||||
#define USE_WX_RESOURCES 1
|
||||
/*
|
||||
* Use wxGraph
|
||||
*/
|
||||
/* #undef USE_WXGRAPH */
|
||||
/*
|
||||
* Use wxTree
|
||||
*/
|
||||
|
||||
/*
|
||||
* Use wxConfig profile management classes (wxFileConfig only under Unix)
|
||||
*/
|
||||
#define USE_WXCONFIG 1
|
||||
|
||||
/********************** DO NOT CHANGE BELOW THIS POINT **********************/
|
||||
|
||||
/**************************** DEBUGGING FEATURES ****************************/
|
||||
|
||||
/* Compatibility with 1.66 API.
|
||||
Level 0: no backward compatibility, all new features
|
||||
Level 1: wxDC, OnSize (etc.) compatibility, but
|
||||
some new features such as event tables */
|
||||
#define WXWIN_COMPATIBILITY 1
|
||||
/*
|
||||
* Enables debugging: memory tracing, assert, etc.
|
||||
*/
|
||||
#define DEBUG 1
|
||||
/*
|
||||
* Enables debugging version of wxObject::new and wxObject::delete (IF DEBUG)
|
||||
* WARNING: this code may not work with all architectures, especially
|
||||
* if alignment is an issue.
|
||||
*/
|
||||
/* #undef USE_MEMORY_TRACING */
|
||||
/*
|
||||
* Enable debugging version of global memory operators new and delete
|
||||
* Disable it, If this causes problems (e.g. link errors)
|
||||
*/
|
||||
/* #undef USE_GLOBAL_MEMORY_OPERATORS */
|
||||
/*
|
||||
* If WXDEBUG && USE_MEMORY_TRACING && USE_GLOBAL_MEMORY_OPERATORS
|
||||
* used to debug the memory allocation of wxWindows Xt port code
|
||||
*/
|
||||
#define USE_INTERNAL_MEMORY_TRACING 0
|
||||
/*
|
||||
* Matthews garbage collection (used for MrEd?)
|
||||
*/
|
||||
#define WXGARBAGE_COLLECTION_ON 0
|
||||
|
||||
/**************************** COMPILER FEATURES *****************************/
|
||||
|
||||
/*
|
||||
* Disable this if your compiler can't cope
|
||||
* with omission of prototype parameters.
|
||||
*/
|
||||
#define REMOVE_UNUSED_ARG 1
|
||||
/*
|
||||
* The const keyword is being introduced more in wxWindows.
|
||||
* You can use this setting to maintain backward compatibility.
|
||||
* If 0: will use const wherever possible.
|
||||
* If 1: will use const only where necessary
|
||||
* for precompiled headers to work.
|
||||
* If 2: will be totally backward compatible, but precompiled
|
||||
* headers may not work and program size will be larger.
|
||||
*/
|
||||
#define CONST_COMPATIBILITY 0
|
||||
|
||||
/************************ WINDOWS 3.1 COMPATIBILITY *************************/
|
||||
|
||||
/*
|
||||
* Normalize X drawing code to behave exactly as MSW.
|
||||
*/
|
||||
#define WX_STANDARD_GRAPHICS 0
|
||||
|
||||
/******************* other stuff **********************************/
|
||||
/*
|
||||
* Support image loading for wxBitmap (wxImage is needed for this)
|
||||
*/
|
||||
#define USE_IMAGE_LOADING 0
|
||||
#define WXIMAGE_INCLUDE "../../utils/image/src/wx_image.h"
|
||||
/*
|
||||
* Use splines
|
||||
*/
|
||||
#define USE_SPLINES 1
|
||||
|
||||
/*
|
||||
* USE_DYNAMIC_CLASSES is TRUE for the Xt port
|
||||
*/
|
||||
#define USE_DYNAMIC_CLASSES 1
|
||||
/*
|
||||
* USE_EXTENDED_STATICS is FALSE for the Xt port
|
||||
*/
|
||||
#define USE_EXTENDED_STATICS 0
|
||||
|
||||
/*************************** IMAKEFILE EVALUATIOS ***************************/
|
||||
|
||||
#if USE_XPM
|
||||
#define USE_XPM_IN_X 1
|
||||
#else
|
||||
#define USE_XPM_IN_X 0
|
||||
#endif
|
||||
#if USE_IMAGE_LOADING
|
||||
#define USE_IMAGE_LOADING_IN_X 1
|
||||
#else
|
||||
#define USE_IMAGE_LOADING_IN_X 0
|
||||
#endif
|
||||
|
||||
/* here comes the system-specific stuff */
|
||||
|
||||
/* acconfig.h
|
||||
This file is in the public domain.
|
||||
|
||||
Descriptive text for the C preprocessor macros that
|
||||
the distributed Autoconf macros can define.
|
||||
No software package will use all of them; autoheader copies the ones
|
||||
your configure.in uses into your configuration header file templates.
|
||||
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). Although this order
|
||||
can split up related entries, it makes it easier to check whether
|
||||
a given entry is in the file. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* #undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
/* #undef C_ALLOCA */
|
||||
|
||||
/* Define if type char is unsigned and you are not using gcc. */
|
||||
#ifndef __CHAR_UNSIGNED__
|
||||
/* #undef __CHAR_UNSIGNED__ */
|
||||
#endif
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
/* #undef CLOSEDIR_VOID */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
/* #undef DGUX */
|
||||
|
||||
/* Define if you have <dirent.h>. */
|
||||
/* #undef DIRENT */
|
||||
|
||||
/* Define to the type of elements in the array set by `getgroups'.
|
||||
Usually this is either `int' or `gid_t'. */
|
||||
#define GETGROUPS_T gid_t
|
||||
|
||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||
/* #undef GETLOADAVG_PRIVILEGED */
|
||||
|
||||
/* Define if the `getpgrp' function takes no argument. */
|
||||
/* #undef GETPGRP_VOID */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef gid_t */
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
/* #undef HAVE_ALLOCA */
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
/* #undef HAVE_ALLOCA_H */
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define if your system has its own `getloadavg' function. */
|
||||
/* #undef HAVE_GETLOADAVG */
|
||||
|
||||
/* Define if you have the getmntent function. */
|
||||
/* #undef HAVE_GETMNTENT */
|
||||
|
||||
/* Define if the `long double' type works. */
|
||||
#define HAVE_LONG_DOUBLE 1
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#define HAVE_LONG_FILE_NAMES 1
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
/* #undef HAVE_MMAP */
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
/* #undef HAVE_RESTARTABLE_SYSCALLS */
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
#define HAVE_ST_BLKSIZE 1
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
#define HAVE_ST_BLOCKS 1
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
/* #undef HAVE_STRCOLL */
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
#define HAVE_ST_RDEV 1
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
/* #undef HAVE_STRFTIME */
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#define HAVE_SYS_WAIT_H 1
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
/* #undef HAVE_TM_ZONE */
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
#define HAVE_TZNAME 1
|
||||
|
||||
/* Define if you have <unistd.h>. */
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
/* #undef HAVE_UTIME_NULL */
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
/* #undef HAVE_VFORK_H */
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
/* #undef HAVE_VPRINTF */
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
/* #undef HAVE_WAIT3 */
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
#ifndef __cplusplus
|
||||
/* #undef inline */
|
||||
#endif
|
||||
|
||||
/* Define if major, minor, and makedev are declared in <mkdev.h>. */
|
||||
/* #undef MAJOR_IN_MKDEV */
|
||||
|
||||
/* Define if major, minor, and makedev are declared in <sysmacros.h>. */
|
||||
/* #undef MAJOR_IN_SYSMACROS */
|
||||
|
||||
/* Define if on MINIX. */
|
||||
/* #undef _MINIX */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef mode_t */
|
||||
|
||||
/* Define if you don't have <dirent.h>, but have <ndir.h>. */
|
||||
/* #undef NDIR */
|
||||
|
||||
/* Define if you have <memory.h>, and <string.h> doesn't declare the
|
||||
mem* functions. */
|
||||
/* #undef NEED_MEMORY_H */
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
/* #undef NLIST_NAME_UNION */
|
||||
|
||||
/* Define if you have <nlist.h>. */
|
||||
/* #undef NLIST_STRUCT */
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
/* #undef off_t */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef pid_t */
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
/* #undef _POSIX_1_SOURCE */
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
/* #undef SETVBUF_REVERSED */
|
||||
|
||||
/* Define SIZESOF for some Objects */
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_INT_P 4
|
||||
#define SIZEOF_LONG 4
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
/* #undef STACK_DIRECTION */
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define on System V Release 4. */
|
||||
/* #undef SVR4 */
|
||||
|
||||
/* Define on BSD */
|
||||
/* #undef BSD */
|
||||
|
||||
/* Define on System V */
|
||||
/* #undef SYSV */
|
||||
|
||||
/* Define if you don't have <dirent.h>, but have <sys/dir.h>. */
|
||||
/* #undef SYSDIR */
|
||||
|
||||
/* Define if you don't have <dirent.h>, but have <sys/ndir.h>. */
|
||||
/* #undef SYSNDIR */
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
/* #undef SYS_SIGLIST_DECLARED */
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
/* #undef TM_IN_SYS_TIME */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef uid_t */
|
||||
|
||||
/* Define for Encore UMAX. */
|
||||
/* #undef UMAX */
|
||||
|
||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>. */
|
||||
/* #undef UMAX4_3 */
|
||||
|
||||
/* Define if you do not have <strings.h>, index, bzero, etc.. */
|
||||
/* #undef USG */
|
||||
|
||||
/* Define if the system is System V Release 4 */
|
||||
/* #undef SVR4 */
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
/* #undef vfork */
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
/* #undef VOID_CLOSEDIR */
|
||||
|
||||
/* Define if your processor stores words with the most significant
|
||||
byte first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
||||
|
||||
/* Define if lex declares yytext as a char * by default, not a char[]. */
|
||||
#define YYTEXT_POINTER 1
|
||||
|
||||
#endif /* __GTKSETUPH__ */
|
||||
|
||||
|
||||
/* Leave that blank line there!! Autoheader needs it.
|
||||
If you're adding to this file, keep in mind:
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). */
|
@ -29,6 +29,8 @@ class wxDC;
|
||||
class wxPaintDC;
|
||||
class wxMemoryDC;
|
||||
class wxToolBarGTK;
|
||||
class wxBitmapButton;
|
||||
class wxStaticBitmap;
|
||||
|
||||
class wxMask;
|
||||
class wxBitmap;
|
||||
@ -55,6 +57,8 @@ class wxMask: public wxObject
|
||||
friend wxDC;
|
||||
friend wxPaintDC;
|
||||
friend wxToolBarGTK;
|
||||
friend wxBitmapButton;
|
||||
friend wxStaticBitmap;
|
||||
|
||||
GdkBitmap *GetBitmap(void) const;
|
||||
|
||||
@ -111,6 +115,8 @@ class wxBitmap: public wxObject
|
||||
friend wxPaintDC;
|
||||
friend wxMemoryDC;
|
||||
friend wxToolBarGTK;
|
||||
friend wxBitmapButton;
|
||||
friend wxStaticBitmap;
|
||||
|
||||
GdkPixmap *GetPixmap(void) const;
|
||||
GdkBitmap *GetBitmap(void) const;
|
||||
|
107
include/wx/gtk1/notebook.h
Normal file
107
include/wx/gtk1/notebook.h
Normal file
@ -0,0 +1,107 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tabctrl.h
|
||||
// Purpose: wxTabCtrl class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __TABCTRLH__
|
||||
#define __TABCTRLH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "notebook.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxImageList;
|
||||
class wxPanel;
|
||||
|
||||
class wxNotebook;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global data
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxNotebook
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxNotebook: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxNotebook)
|
||||
|
||||
public:
|
||||
|
||||
wxNotebook(void);
|
||||
wxNotebook( wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = 0, const wxString& name = "notebook" );
|
||||
~wxNotebook(void);
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = 0, const wxString& name = "notebook" );
|
||||
int GetSelection(void) const;
|
||||
wxImageList* GetImageList(void) const;
|
||||
int GetPageCount(void) const;
|
||||
int GetRowCount(void) const;
|
||||
wxString GetPageText( const int page ) const;
|
||||
int GetPageImage( const int page ) const;
|
||||
void* GetPageData( const int page ) const;
|
||||
int SetSelection( const int page );
|
||||
void SetImageList( wxImageList* imageList );
|
||||
bool SetPageText( const int page, const wxString& text );
|
||||
bool SetPageImage( const int oage, const int image );
|
||||
bool SetPageData( const int page, void* data );
|
||||
void SetPageSize( const wxSize& size );
|
||||
void SetPadding( const wxSize& padding );
|
||||
bool DeleteAllPages(void);
|
||||
bool DeletePage( const int page );
|
||||
wxPanel *CreatePage( const int page, const wxString& text, const int imageId = -1, void* data = NULL );
|
||||
wxPanel *GetPanel( const int page );
|
||||
|
||||
// overriden to do nothing
|
||||
virtual void AddChild( wxWindow *win );
|
||||
|
||||
protected:
|
||||
|
||||
wxImageList* m_imageList;
|
||||
wxList m_pages;
|
||||
GtkWidget *m_frame;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTabEvent
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxTabEvent: public wxCommandEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabEvent)
|
||||
|
||||
public:
|
||||
|
||||
wxTabEvent( WXTYPE commandType = 0, int id = 0 );
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&);
|
||||
|
||||
#define EVT_TAB_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGED, \
|
||||
id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL },
|
||||
#define EVT_TAB_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGING, \
|
||||
id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL },
|
||||
|
||||
#endif
|
||||
// __TABCTRLH__
|
@ -1,539 +0,0 @@
|
||||
/* ../../include/wx/gtk/setup.h. Generated automatically by configure. */
|
||||
/* wx_setup.h
|
||||
This file is in the public domain.
|
||||
|
||||
Descriptive text for the C preprocessor macros that
|
||||
the distributed Autoconf macros can define.
|
||||
No software package will use all of them; autoheader copies the ones
|
||||
your configure.in uses into your configuration header file templates.
|
||||
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). Although this order
|
||||
can split up related entries, it makes it easier to check whether
|
||||
a given entry is in the file.
|
||||
|
||||
Leave the following blank line there!! Autoheader needs it. */
|
||||
|
||||
#ifndef __GTKSETUPH__
|
||||
#define __GTKSETUPH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
/* define the system to compile */
|
||||
#define __GTK__ 1
|
||||
#define __UNIX__ 1
|
||||
#define __LINUX__ 1
|
||||
/* #undef __SGI__ */
|
||||
/* #undef __HPUX__ */
|
||||
/* #undef __SYSV__ */
|
||||
/* #undef __SVR4__ */
|
||||
/* #undef __AIX__ */
|
||||
/* #undef __SUN__ */
|
||||
/* #undef __SOLARIS__ */
|
||||
/* #undef __SUNOS__ */
|
||||
/* #undef __ALPHA__ */
|
||||
/* #undef __OSF__ */
|
||||
/* #undef __BSD__ */
|
||||
/* #undef __FREEBSD__ */
|
||||
/* #undef __VMS__ */
|
||||
/* #undef __ULTRIX__ */
|
||||
/* #undef __DATA_GENERAL__ */
|
||||
|
||||
/*
|
||||
* Use zlib
|
||||
*/
|
||||
#define USE_ZLIB 1
|
||||
/*
|
||||
* Use gdk_imlib
|
||||
*/
|
||||
#define USE_GDK_IMLIB 1
|
||||
/*
|
||||
* Use libpng
|
||||
*/
|
||||
#define USE_LIBPNG 1
|
||||
/*
|
||||
* Use Threads
|
||||
*/
|
||||
/* #undef USE_THREADS */
|
||||
/* #undef USE_THREADS_POSIX */
|
||||
/* #undef USE_THREADS_SGI */
|
||||
/*
|
||||
* Use storable classes
|
||||
*/
|
||||
#define USE_STORABLE_CLASSES 1
|
||||
/*
|
||||
* Use automatic translation via gettext() in wxTString
|
||||
*/
|
||||
#define USE_AUTOTRANS 1
|
||||
/*
|
||||
* Use font metric files in GetTextExtent for wxPostScriptDC
|
||||
* Use consistent PostScript fonts for AFM and printing (!)
|
||||
*/
|
||||
#define USE_AFM_FOR_POSTSCRIPT 1
|
||||
#define WX_NORMALIZED_PS_FONTS 1
|
||||
/*
|
||||
* Use clipboard
|
||||
*/
|
||||
/* #undef USE_CLIPBOARD */
|
||||
/*
|
||||
* Use wxWindows layout constraint system
|
||||
*/
|
||||
#define USE_CONSTRAINTS 1
|
||||
/*
|
||||
* Use the document/view architecture
|
||||
*/
|
||||
#define USE_DOC_VIEW_ARCHITECTURE 1
|
||||
/*
|
||||
* Use enhanced dialog
|
||||
*/
|
||||
/* #undef USE_ENHANCED_DIALOG */
|
||||
/*
|
||||
* Use Form panel item placement
|
||||
*/
|
||||
/* #undef USE_FORM */
|
||||
/*
|
||||
* Use fraction class
|
||||
*/
|
||||
#define USE_FRACTION 1
|
||||
/*
|
||||
* Use gauge item
|
||||
*/
|
||||
#define USE_GAUGE 1
|
||||
/*
|
||||
* Implement a GLCanvas class as an interface to OpenGL, using the GLX
|
||||
* extension to the X11 protocol. You can use the (free) Mesa library
|
||||
* if you don't have a 'real' OpenGL.
|
||||
*/
|
||||
#define USE_GLX 0
|
||||
/*
|
||||
* Use wxWindows help facility (needs USE_IPC 1)
|
||||
*/
|
||||
/* #undef USE_HELP */
|
||||
/*
|
||||
* Use iostream.h rather than iostream
|
||||
*/
|
||||
#define USE_IOSTREAMH 1
|
||||
/*
|
||||
* Use Interprocess communication
|
||||
*/
|
||||
#define USE_IPC 1
|
||||
/*
|
||||
* Use Metafile and Metafile device context
|
||||
*/
|
||||
/* #undef USE_METAFILE */
|
||||
/*
|
||||
* Use PostScript device context
|
||||
*/
|
||||
#define USE_POSTSCRIPT 1
|
||||
/*
|
||||
* Use the print/preview architecture
|
||||
*/
|
||||
#define USE_PRINTING_ARCHITECTURE 1
|
||||
/*
|
||||
* Use Prolog IO
|
||||
*/
|
||||
/* #undef USE_PROLOGIO */
|
||||
/*
|
||||
* Use Remote Procedure Call (Needs USE_IPC and USE_PROLOGIO)
|
||||
*/
|
||||
/* #undef USE_RPC */
|
||||
/*
|
||||
* Use wxGetResource & wxWriteResource (change .Xdefaults)
|
||||
*/
|
||||
#define USE_RESOURCES 1
|
||||
/*
|
||||
* Use scrollbar item
|
||||
*/
|
||||
#define USE_SCROLLBAR 1
|
||||
/*
|
||||
* Use time and date classes
|
||||
*/
|
||||
#define USE_TIMEDATE 1
|
||||
/*
|
||||
* Use toolbar, use Xt port toolbar (3D look)
|
||||
*/
|
||||
#define USE_TOOLBAR 1
|
||||
#define USE_XT_TOOLBAR
|
||||
/*
|
||||
* Enables old type checking mechanism (wxSubType)
|
||||
*/
|
||||
/* #undef USE_TYPETREE */
|
||||
/*
|
||||
* Use virtual list box item
|
||||
*/
|
||||
/* #undef USE_VLBOX */
|
||||
/*
|
||||
* Use wxWindows resource loading (.wxr-files) (Needs USE_PROLOGIO 1)
|
||||
*/
|
||||
#define USE_WX_RESOURCES 1
|
||||
/*
|
||||
* Use wxGraph
|
||||
*/
|
||||
/* #undef USE_WXGRAPH */
|
||||
/*
|
||||
* Use wxTree
|
||||
*/
|
||||
|
||||
/*
|
||||
* Use wxConfig profile management classes (wxFileConfig only under Unix)
|
||||
*/
|
||||
#define USE_WXCONFIG 1
|
||||
|
||||
/********************** DO NOT CHANGE BELOW THIS POINT **********************/
|
||||
|
||||
/**************************** DEBUGGING FEATURES ****************************/
|
||||
|
||||
/* Compatibility with 1.66 API.
|
||||
Level 0: no backward compatibility, all new features
|
||||
Level 1: wxDC, OnSize (etc.) compatibility, but
|
||||
some new features such as event tables */
|
||||
#define WXWIN_COMPATIBILITY 1
|
||||
/*
|
||||
* Enables debugging: memory tracing, assert, etc.
|
||||
*/
|
||||
#define DEBUG 1
|
||||
/*
|
||||
* Enables debugging version of wxObject::new and wxObject::delete (IF DEBUG)
|
||||
* WARNING: this code may not work with all architectures, especially
|
||||
* if alignment is an issue.
|
||||
*/
|
||||
/* #undef USE_MEMORY_TRACING */
|
||||
/*
|
||||
* Enable debugging version of global memory operators new and delete
|
||||
* Disable it, If this causes problems (e.g. link errors)
|
||||
*/
|
||||
/* #undef USE_GLOBAL_MEMORY_OPERATORS */
|
||||
/*
|
||||
* If WXDEBUG && USE_MEMORY_TRACING && USE_GLOBAL_MEMORY_OPERATORS
|
||||
* used to debug the memory allocation of wxWindows Xt port code
|
||||
*/
|
||||
#define USE_INTERNAL_MEMORY_TRACING 0
|
||||
/*
|
||||
* Matthews garbage collection (used for MrEd?)
|
||||
*/
|
||||
#define WXGARBAGE_COLLECTION_ON 0
|
||||
|
||||
/**************************** COMPILER FEATURES *****************************/
|
||||
|
||||
/*
|
||||
* Disable this if your compiler can't cope
|
||||
* with omission of prototype parameters.
|
||||
*/
|
||||
#define REMOVE_UNUSED_ARG 1
|
||||
/*
|
||||
* The const keyword is being introduced more in wxWindows.
|
||||
* You can use this setting to maintain backward compatibility.
|
||||
* If 0: will use const wherever possible.
|
||||
* If 1: will use const only where necessary
|
||||
* for precompiled headers to work.
|
||||
* If 2: will be totally backward compatible, but precompiled
|
||||
* headers may not work and program size will be larger.
|
||||
*/
|
||||
#define CONST_COMPATIBILITY 0
|
||||
|
||||
/************************ WINDOWS 3.1 COMPATIBILITY *************************/
|
||||
|
||||
/*
|
||||
* Normalize X drawing code to behave exactly as MSW.
|
||||
*/
|
||||
#define WX_STANDARD_GRAPHICS 0
|
||||
|
||||
/******************* other stuff **********************************/
|
||||
/*
|
||||
* Support image loading for wxBitmap (wxImage is needed for this)
|
||||
*/
|
||||
#define USE_IMAGE_LOADING 0
|
||||
#define WXIMAGE_INCLUDE "../../utils/image/src/wx_image.h"
|
||||
/*
|
||||
* Use splines
|
||||
*/
|
||||
#define USE_SPLINES 1
|
||||
|
||||
/*
|
||||
* USE_DYNAMIC_CLASSES is TRUE for the Xt port
|
||||
*/
|
||||
#define USE_DYNAMIC_CLASSES 1
|
||||
/*
|
||||
* USE_EXTENDED_STATICS is FALSE for the Xt port
|
||||
*/
|
||||
#define USE_EXTENDED_STATICS 0
|
||||
|
||||
/*************************** IMAKEFILE EVALUATIOS ***************************/
|
||||
|
||||
#if USE_XPM
|
||||
#define USE_XPM_IN_X 1
|
||||
#else
|
||||
#define USE_XPM_IN_X 0
|
||||
#endif
|
||||
#if USE_IMAGE_LOADING
|
||||
#define USE_IMAGE_LOADING_IN_X 1
|
||||
#else
|
||||
#define USE_IMAGE_LOADING_IN_X 0
|
||||
#endif
|
||||
|
||||
/* here comes the system-specific stuff */
|
||||
|
||||
/* acconfig.h
|
||||
This file is in the public domain.
|
||||
|
||||
Descriptive text for the C preprocessor macros that
|
||||
the distributed Autoconf macros can define.
|
||||
No software package will use all of them; autoheader copies the ones
|
||||
your configure.in uses into your configuration header file templates.
|
||||
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). Although this order
|
||||
can split up related entries, it makes it easier to check whether
|
||||
a given entry is in the file. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* #undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
/* #undef C_ALLOCA */
|
||||
|
||||
/* Define if type char is unsigned and you are not using gcc. */
|
||||
#ifndef __CHAR_UNSIGNED__
|
||||
/* #undef __CHAR_UNSIGNED__ */
|
||||
#endif
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
/* #undef CLOSEDIR_VOID */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
/* #undef DGUX */
|
||||
|
||||
/* Define if you have <dirent.h>. */
|
||||
/* #undef DIRENT */
|
||||
|
||||
/* Define to the type of elements in the array set by `getgroups'.
|
||||
Usually this is either `int' or `gid_t'. */
|
||||
#define GETGROUPS_T gid_t
|
||||
|
||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||
/* #undef GETLOADAVG_PRIVILEGED */
|
||||
|
||||
/* Define if the `getpgrp' function takes no argument. */
|
||||
/* #undef GETPGRP_VOID */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef gid_t */
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
/* #undef HAVE_ALLOCA */
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
/* #undef HAVE_ALLOCA_H */
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define if your system has its own `getloadavg' function. */
|
||||
/* #undef HAVE_GETLOADAVG */
|
||||
|
||||
/* Define if you have the getmntent function. */
|
||||
/* #undef HAVE_GETMNTENT */
|
||||
|
||||
/* Define if the `long double' type works. */
|
||||
#define HAVE_LONG_DOUBLE 1
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#define HAVE_LONG_FILE_NAMES 1
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
/* #undef HAVE_MMAP */
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
/* #undef HAVE_RESTARTABLE_SYSCALLS */
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
#define HAVE_ST_BLKSIZE 1
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
#define HAVE_ST_BLOCKS 1
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
/* #undef HAVE_STRCOLL */
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
#define HAVE_ST_RDEV 1
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
/* #undef HAVE_STRFTIME */
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#define HAVE_SYS_WAIT_H 1
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
/* #undef HAVE_TM_ZONE */
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
#define HAVE_TZNAME 1
|
||||
|
||||
/* Define if you have <unistd.h>. */
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
/* #undef HAVE_UTIME_NULL */
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
/* #undef HAVE_VFORK_H */
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
/* #undef HAVE_VPRINTF */
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
/* #undef HAVE_WAIT3 */
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
#ifndef __cplusplus
|
||||
/* #undef inline */
|
||||
#endif
|
||||
|
||||
/* Define if major, minor, and makedev are declared in <mkdev.h>. */
|
||||
/* #undef MAJOR_IN_MKDEV */
|
||||
|
||||
/* Define if major, minor, and makedev are declared in <sysmacros.h>. */
|
||||
/* #undef MAJOR_IN_SYSMACROS */
|
||||
|
||||
/* Define if on MINIX. */
|
||||
/* #undef _MINIX */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef mode_t */
|
||||
|
||||
/* Define if you don't have <dirent.h>, but have <ndir.h>. */
|
||||
/* #undef NDIR */
|
||||
|
||||
/* Define if you have <memory.h>, and <string.h> doesn't declare the
|
||||
mem* functions. */
|
||||
/* #undef NEED_MEMORY_H */
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
/* #undef NLIST_NAME_UNION */
|
||||
|
||||
/* Define if you have <nlist.h>. */
|
||||
/* #undef NLIST_STRUCT */
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
/* #undef off_t */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef pid_t */
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
/* #undef _POSIX_1_SOURCE */
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
/* #undef SETVBUF_REVERSED */
|
||||
|
||||
/* Define SIZESOF for some Objects */
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_INT_P 4
|
||||
#define SIZEOF_LONG 4
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
/* #undef STACK_DIRECTION */
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define on System V Release 4. */
|
||||
/* #undef SVR4 */
|
||||
|
||||
/* Define on BSD */
|
||||
/* #undef BSD */
|
||||
|
||||
/* Define on System V */
|
||||
/* #undef SYSV */
|
||||
|
||||
/* Define if you don't have <dirent.h>, but have <sys/dir.h>. */
|
||||
/* #undef SYSDIR */
|
||||
|
||||
/* Define if you don't have <dirent.h>, but have <sys/ndir.h>. */
|
||||
/* #undef SYSNDIR */
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
/* #undef SYS_SIGLIST_DECLARED */
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
/* #undef TM_IN_SYS_TIME */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef uid_t */
|
||||
|
||||
/* Define for Encore UMAX. */
|
||||
/* #undef UMAX */
|
||||
|
||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>. */
|
||||
/* #undef UMAX4_3 */
|
||||
|
||||
/* Define if you do not have <strings.h>, index, bzero, etc.. */
|
||||
/* #undef USG */
|
||||
|
||||
/* Define if the system is System V Release 4 */
|
||||
/* #undef SVR4 */
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
/* #undef vfork */
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
/* #undef VOID_CLOSEDIR */
|
||||
|
||||
/* Define if your processor stores words with the most significant
|
||||
byte first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
||||
|
||||
/* Define if lex declares yytext as a char * by default, not a char[]. */
|
||||
#define YYTEXT_POINTER 1
|
||||
|
||||
#endif /* __GTKSETUPH__ */
|
||||
|
||||
|
||||
/* Leave that blank line there!! Autoheader needs it.
|
||||
If you're adding to this file, keep in mind:
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). */
|
11
include/wx/notebook.h
Normal file
11
include/wx/notebook.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef __NOTEBOOKH_BASE__
|
||||
#define __NOTEBOOKH_BASE__
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
#elif defined(__MOTIF__)
|
||||
#elif defined(__GTK__)
|
||||
#include "wx/gtk/notebook.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __NOTEBOOKH_BASE__
|
@ -6,7 +6,6 @@
|
||||
#elif defined(__MOTIF__)
|
||||
#include "wx/xt/tabctrl.h"
|
||||
#elif defined(__GTK__)
|
||||
#include "wx/gtk/tabctrl.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
530
install/gtk/configure
vendored
530
install/gtk/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -658,6 +658,7 @@ DEFAULT_USE_THREADS_SGI=0
|
||||
DEFAULT_USE_THREADS_POSIX=0
|
||||
DEFAULT_USE_OPENGL=0
|
||||
|
||||
DEFAULT_USE_WXCONFIG=1
|
||||
DEFAULT_USE_POSTSCRIPT=1
|
||||
DEFAULT_USE_IPC=1
|
||||
DEFAULT_USE_RESOURCES=1
|
||||
@ -771,6 +772,10 @@ AC_OVERRIDES(postscript, postscript,
|
||||
**--with-postscript use postscript-device-context,
|
||||
USE_POSTSCRIPT)
|
||||
|
||||
AC_OVERRIDES(wxconfig, wxconfig,
|
||||
**--with-wxconfig use wxconfig,
|
||||
USE_WXCONFIG)
|
||||
|
||||
AC_OVERRIDES(metafile, metafile,
|
||||
**--with-metafile use metafile,
|
||||
USE_METAFILE)
|
||||
@ -974,6 +979,10 @@ if test "$USE_POSTSCRIPT" = 1 ; then
|
||||
fi
|
||||
AC_SUBST(POSTSCRIPTDC)
|
||||
|
||||
if test "$USE_WXCONFIG" = 1 ; then
|
||||
AC_DEFINE_UNQUOTED(USE_WXCONFIG,$USE_WXCONFIG)
|
||||
fi
|
||||
|
||||
METAFILE=NONE
|
||||
if test "$USE_METAFILE" = 1 ; then
|
||||
METAFILE="METAFILE"
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/tabctrl.h"
|
||||
#include "wx/notebook.h"
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// class definitions
|
||||
@ -49,7 +49,7 @@ class MyPanel: public wxPanel
|
||||
wxListBox *m_listbox;
|
||||
|
||||
wxTextCtrl *m_text;
|
||||
wxTabCtrl *m_tab;
|
||||
wxNotebook *m_notebook;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
@ -115,7 +115,7 @@ bool MyApp::OnInit(void)
|
||||
// MyPanel
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const MINIMAL_TAB = 1000;
|
||||
const ID_NOTEBOOK = 1000;
|
||||
|
||||
const ID_LISTBOX = 130;
|
||||
const ID_LISTBOX_SEL_NUM = 131;
|
||||
@ -137,7 +137,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
|
||||
{
|
||||
m_text = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE );
|
||||
|
||||
m_tab = new wxTabCtrl( this, MINIMAL_TAB, wxPoint(0,0), wxSize(200,150) );
|
||||
m_notebook = new wxNotebook( this, ID_NOTEBOOK, wxPoint(0,0), wxSize(200,150) );
|
||||
|
||||
wxString choices[4] =
|
||||
{
|
||||
@ -147,14 +147,15 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
|
||||
"wonderfull example."
|
||||
};
|
||||
|
||||
m_tab->InsertItem( 0, "wxList" );
|
||||
m_listbox = new wxListBox( m_tab, ID_LISTBOX, wxPoint(10,10), wxSize(120,70), 4, choices );
|
||||
(void)new wxButton( m_tab, ID_LISTBOX_SEL_NUM, "Select #2", wxPoint(140,30), wxSize(100,30) );
|
||||
(void)new wxButton( m_tab, ID_LISTBOX_SEL_STR, "Select 'This'", wxPoint(260,30), wxSize(100,30) );
|
||||
(void)new wxButton( m_tab, ID_LISTBOX_CLEAR, "Clear", wxPoint(140,80), wxSize(100,30) );
|
||||
(void)new wxButton( m_tab, ID_LISTBOX_APPEND, "Append 'Hi!'", wxPoint(260,80), wxSize(100,30) );
|
||||
wxPanel *panel = m_notebook->CreatePage( 0, "wxList" );
|
||||
|
||||
m_tab->InsertItem( 1, "wxChoice" );
|
||||
m_listbox = new wxListBox( panel, ID_LISTBOX, wxPoint(10,10), wxSize(120,70), 4, choices );
|
||||
(void)new wxButton( panel, ID_LISTBOX_SEL_NUM, "Select #2", wxPoint(140,30), wxSize(100,30) );
|
||||
(void)new wxButton( panel, ID_LISTBOX_SEL_STR, "Select 'This'", wxPoint(260,30), wxSize(100,30) );
|
||||
(void)new wxButton( panel, ID_LISTBOX_CLEAR, "Clear", wxPoint(140,80), wxSize(100,30) );
|
||||
(void)new wxButton( panel, ID_LISTBOX_APPEND, "Append 'Hi!'", wxPoint(260,80), wxSize(100,30) );
|
||||
|
||||
m_notebook->CreatePage( 1, "wxChoice" );
|
||||
}
|
||||
|
||||
void MyPanel::OnSize( wxSizeEvent& WXUNUSED(event) )
|
||||
@ -163,7 +164,7 @@ void MyPanel::OnSize( wxSizeEvent& WXUNUSED(event) )
|
||||
int y = 0;
|
||||
GetClientSize( &x, &y );
|
||||
|
||||
if (m_tab) m_tab->SetSize( 2, 2, x-4, y/2-4 );
|
||||
if (m_notebook) m_notebook->SetSize( 2, 2, x-4, y/2-4 );
|
||||
if (m_text) m_text->SetSize( 2, y/2+2, x-4, y/2-4 );
|
||||
}
|
||||
|
||||
|
@ -82,6 +82,7 @@ LIB_CPP_SRC=\
|
||||
gtk/listbox.cpp \
|
||||
gtk/mdi.cpp \
|
||||
gtk/menu.cpp \
|
||||
gtk/notebook.cpp \
|
||||
gtk/palette.cpp \
|
||||
gtk/pen.cpp \
|
||||
gtk/radiobox.cpp \
|
||||
@ -93,7 +94,6 @@ LIB_CPP_SRC=\
|
||||
gtk/statbox.cpp \
|
||||
gtk/statbmp.cpp \
|
||||
gtk/stattext.cpp \
|
||||
gtk/tabctrl.cpp \
|
||||
gtk/tbargtk.cpp \
|
||||
gtk/textctrl.cpp \
|
||||
gtk/timer.cpp \
|
||||
|
384
src/gtk/notebook.cpp
Normal file
384
src/gtk/notebook.cpp
Normal file
@ -0,0 +1,384 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: notebook.cpp
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Created: 01/02/97
|
||||
// Id:
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "notebook.h"
|
||||
#endif
|
||||
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/panel.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/imaglist.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxNotebookPage
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxNotebookPage: public wxObject
|
||||
{
|
||||
public:
|
||||
|
||||
int m_id;
|
||||
wxString m_text;
|
||||
int m_image;
|
||||
void *m_clientData;
|
||||
GtkNotebookPage *m_page;
|
||||
wxPanel *m_clientPanel;
|
||||
|
||||
wxNotebookPage(void)
|
||||
{
|
||||
m_id = -1;
|
||||
m_text = "";
|
||||
m_image = -1;
|
||||
m_clientData = NULL;
|
||||
m_page = NULL;
|
||||
m_clientPanel = NULL;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxNotebook
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxNotebook,wxControl)
|
||||
|
||||
wxNotebook::wxNotebook(void)
|
||||
{
|
||||
m_imageList = NULL;
|
||||
m_frame = NULL;
|
||||
m_pages.DeleteContents( TRUE );
|
||||
};
|
||||
|
||||
wxNotebook::wxNotebook( wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
const long style, const wxString& name )
|
||||
{
|
||||
m_imageList = NULL;
|
||||
m_frame = NULL;
|
||||
m_pages.DeleteContents( TRUE );
|
||||
Create( parent, id, pos, size, style, name );
|
||||
};
|
||||
|
||||
wxNotebook::~wxNotebook(void)
|
||||
{
|
||||
if (m_imageList) delete m_imageList;
|
||||
DeleteAllPages();
|
||||
};
|
||||
|
||||
bool wxNotebook::Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
const long style, const wxString& name )
|
||||
{
|
||||
m_needParent = TRUE;
|
||||
|
||||
PreCreation( parent, id, pos, size, style, name );
|
||||
|
||||
m_widget = gtk_notebook_new();
|
||||
|
||||
PostCreation();
|
||||
|
||||
Show( TRUE );
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
int wxNotebook::GetSelection(void) const
|
||||
{
|
||||
if (m_pages.Number() == 0) return -1;
|
||||
|
||||
GtkNotebookPage *g_page = GTK_NOTEBOOK(m_widget)->cur_page;
|
||||
|
||||
wxNotebookPage *page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
page = (wxNotebookPage*)node->Data();
|
||||
if (page->m_page == g_page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
|
||||
if (!node) wxFatalError( "Notebook error." );
|
||||
|
||||
return page->m_id;
|
||||
};
|
||||
|
||||
wxImageList* wxNotebook::GetImageList(void) const
|
||||
{
|
||||
return m_imageList;
|
||||
};
|
||||
|
||||
int wxNotebook::GetPageCount(void) const
|
||||
{
|
||||
return m_pages.Number();
|
||||
};
|
||||
|
||||
int wxNotebook::GetRowCount(void) const
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
|
||||
wxString wxNotebook::GetPageText( const int page ) const
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return "";
|
||||
|
||||
return nb_page->m_text;
|
||||
};
|
||||
|
||||
int wxNotebook::GetPageImage( const int page ) const
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return -1;
|
||||
|
||||
return nb_page->m_image;
|
||||
};
|
||||
|
||||
void* wxNotebook::GetPageData( const int page ) const
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return NULL;
|
||||
|
||||
return nb_page->m_clientData;
|
||||
};
|
||||
|
||||
int wxNotebook::SetSelection( const int page )
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return -1;
|
||||
|
||||
int page_num = 0;
|
||||
GList *child = GTK_NOTEBOOK(m_widget)->children;
|
||||
while (child)
|
||||
{
|
||||
if (nb_page->m_page == (GtkNotebookPage*)child->data) break;
|
||||
page_num++;
|
||||
child = child->next;
|
||||
};
|
||||
|
||||
if (!child) return -1;
|
||||
|
||||
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page_num );
|
||||
|
||||
return page;
|
||||
};
|
||||
|
||||
void wxNotebook::SetImageList( wxImageList* imageList )
|
||||
{
|
||||
m_imageList = imageList;
|
||||
};
|
||||
|
||||
bool wxNotebook::SetPageText( const int page, const wxString &text )
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return FALSE;
|
||||
|
||||
nb_page->m_text = text;
|
||||
|
||||
// recreate
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxNotebook::SetPageImage( const int page, const int image )
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return FALSE;
|
||||
|
||||
nb_page->m_image = image;
|
||||
|
||||
// recreate
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxNotebook::SetPageData( const int page, void* data )
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return FALSE;
|
||||
|
||||
nb_page->m_clientData = data;
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
|
||||
{
|
||||
};
|
||||
|
||||
void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) )
|
||||
{
|
||||
// what's this ?
|
||||
};
|
||||
|
||||
bool wxNotebook::DeleteAllPages(void)
|
||||
{
|
||||
wxNode *page_node = m_pages.First();
|
||||
while (page_node)
|
||||
{
|
||||
wxNotebookPage *page = (wxNotebookPage*)page_node->Data();
|
||||
|
||||
DeletePage( page->m_id );
|
||||
|
||||
page_node = m_pages.First();
|
||||
};
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxNotebook::DeletePage( const int page )
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return FALSE;
|
||||
|
||||
int page_num = 0;
|
||||
GList *child = GTK_NOTEBOOK(m_widget)->children;
|
||||
while (child)
|
||||
{
|
||||
if (nb_page->m_page == (GtkNotebookPage*)child->data) break;
|
||||
page_num++;
|
||||
child = child->next;
|
||||
};
|
||||
|
||||
if (!child) wxFatalError( "Notebook delete error" );;
|
||||
|
||||
gtk_notebook_remove_page( GTK_NOTEBOOK(m_widget), page_num );
|
||||
|
||||
m_pages.DeleteObject( nb_page );
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
wxPanel *wxNotebook::CreatePage( const int item, const wxString &text, const int imageId, void* data )
|
||||
{
|
||||
wxNotebookPage *page = new wxNotebookPage;
|
||||
|
||||
page->m_text = text;
|
||||
if (page->m_text.IsNull()) page->m_text = "";
|
||||
page->m_id = item;
|
||||
page->m_image = imageId;
|
||||
page->m_clientData = data;
|
||||
|
||||
m_frame = gtk_label_new( page->m_text );
|
||||
gtk_misc_set_alignment( GTK_MISC(m_frame), 0.0, 0.5 );
|
||||
|
||||
page->m_clientPanel = new wxPanel( this, -1, wxPoint(0,0), wxSize(100,100) );
|
||||
|
||||
m_frame = NULL;
|
||||
|
||||
page->m_page = GTK_NOTEBOOK(m_widget)->cur_page;
|
||||
|
||||
m_pages.Append( page );
|
||||
|
||||
return page->m_clientPanel;
|
||||
};
|
||||
|
||||
wxPanel *wxNotebook::GetPanel( const int page )
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return NULL;
|
||||
|
||||
return nb_page->m_clientPanel;
|
||||
};
|
||||
|
||||
void wxNotebook::AddChild( wxWindow *win )
|
||||
{
|
||||
if (!m_frame) wxFatalError( "Notebook::Addchild() must not be called directly." );
|
||||
|
||||
gtk_notebook_append_page( GTK_NOTEBOOK(m_widget), win->m_widget, m_frame );
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTabEvent
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent)
|
||||
|
||||
wxTabEvent::wxTabEvent( WXTYPE commandType, int id ) :
|
||||
wxCommandEvent(commandType, id)
|
||||
{
|
||||
};
|
||||
|
@ -1,123 +0,0 @@
|
||||
# Makefile for Autoconf.
|
||||
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program 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 General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
#### Start of system configuration section. ####
|
||||
|
||||
GLOBAL_LIB_DIR = $(WXBASEDIR)/lib/$(OS)
|
||||
GLOBAL_BIN_DIR = $(WXBASEDIR)/bin/$(OS)
|
||||
|
||||
# define toolkit to use
|
||||
TOOLKIT_DEF = -D__GTK__
|
||||
|
||||
# general compiler stuff
|
||||
OPTIMISE = -O2
|
||||
PROFILE =
|
||||
DEBUG =
|
||||
|
||||
# c-compiler stuff
|
||||
CC = gcc
|
||||
CFLAGS = -Wall $(OPTIMISE) $(PROFILE) $(DEBUG)
|
||||
CPP = gcc -E
|
||||
|
||||
# c++-compiler stuff
|
||||
CXX = c++
|
||||
CXXFLAGS = -Wall $(OPTIMISE) $(PROFILE) $(DEBUG)
|
||||
CXXCPP = c++ -E
|
||||
|
||||
# shared compile stuff
|
||||
PICFLAGS =
|
||||
CREATE_SHARED =
|
||||
|
||||
# other stuff
|
||||
RM = rm -f
|
||||
LEX = flex
|
||||
LEXLIB = -lfl
|
||||
YACC = bison -y
|
||||
RANLIB = ranlib
|
||||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
AWK = mawk
|
||||
LN_S = ln -s
|
||||
CJPEG_PROG =
|
||||
CONVERT_PATH = /usr/bin/X11
|
||||
CONVERT_PROG = /usr/bin/X11/convert
|
||||
DJPEG_PROG =
|
||||
GIFTOPNM_PROG =
|
||||
NETPBM_PATH =
|
||||
|
||||
prefix = /usr/local
|
||||
exec_prefix = ${prefix}
|
||||
|
||||
# Directory in which to install scripts.
|
||||
#bindir = ${exec_prefix}/bin
|
||||
|
||||
# Directory in which to install library files.
|
||||
datadir = ${prefix}/share
|
||||
acdatadir = $(datadir)/autoconf
|
||||
|
||||
# Directory in which to install documentation info files.
|
||||
infodir = ${prefix}/info
|
||||
|
||||
X_CFLAGS = -I/usr/X11R6/include
|
||||
X_LIBS = -L/usr/X11R6/lib
|
||||
X_EXTRA_LIBS =
|
||||
X_PRE_LIBS = -lSM -lICE
|
||||
|
||||
GUI_TK_INCLUDE = -I/usr/local/lib/glib/include -I/usr/local/include -I/usr/X11R6/include
|
||||
GUI_TK_LIBRARY = -L/usr/local/lib -L/usr/X11R6/lib -lgtk -lgdk -lglib -lXext -lX11 -lm
|
||||
GUI_TK_LINK =
|
||||
|
||||
OPENGL_INCLUDE =
|
||||
OPENGL_LIBRARY =
|
||||
OPENGL_LINK =
|
||||
|
||||
THREADS_LINK =
|
||||
|
||||
# INCLUDES
|
||||
WX_INCLUDES = \
|
||||
$(TOOLKIT_DEF) \
|
||||
-I. \
|
||||
-I.. \
|
||||
-I$(WXBASEDIR)/include \
|
||||
-I$(WXBASEDIR)/src/png \
|
||||
-I$(WXBASEDIR)/src/zlib \
|
||||
-I$(WXBASEDIR)/src/gdk_imlib \
|
||||
$(GUI_TK_INCLUDE) \
|
||||
$(OPENGL_INCLUDE) \
|
||||
$(X_CFLAGS)
|
||||
|
||||
WX_LIBS = -L$(GLOBAL_LIB_DIR) -lwx_gtk
|
||||
|
||||
OPENGL_LIBS = $(OPENGL_LIBRARY) $(OPENGL_LINK)
|
||||
|
||||
GUI_TK_LIBS = $(GUI_TK_LIBRARY) $(GUI_TK_LINK)
|
||||
|
||||
LINK = $(CXX) -o $@
|
||||
LINK_LIBS= \
|
||||
$(WX_LIBS) \
|
||||
$(GUI_TK_LIBS) \
|
||||
$(X_EXTRA_LIBS) \
|
||||
$(X_PRE_LIBS)
|
||||
|
||||
# $(X_LIBS) -lX11 -lXext -lm gtk-config does this for me
|
||||
|
||||
# Don't include $(OPENGL_LIBS) or $(THREADS_LINK) in LINK_LIBS; they
|
||||
# can be conveniently added to BIN_LINK in Makefile.in.
|
||||
|
||||
#### End of system configuration section. ####
|
@ -1,70 +0,0 @@
|
||||
s|@OS@|linux|g
|
||||
s|@WXBASEDIR@|/home/karl/cvs/wxWindows|g
|
||||
s|@PROFILE@||g
|
||||
s|@DEBUG@||g
|
||||
s|@OPTIMISE@|-O2 |g
|
||||
s|@CC@|gcc|g
|
||||
s|@CFLAGS@| -Wall|g
|
||||
s|@CPP@|gcc -E|g
|
||||
s|@CXX@|c++|g
|
||||
s|@CXXFLAGS@| -Wall|g
|
||||
s|@CXXCPP@|c++ -E|g
|
||||
s|@PICFLAGS@||g
|
||||
s|@CREATE_SHARED@||g
|
||||
s|@LEX@|flex|g
|
||||
s|@LEXLIB@|-lfl|g
|
||||
s|@YACC@|bison -y|g
|
||||
s|@RANLIB@|ranlib|g
|
||||
s|@INSTALL@|/usr/bin/install -c|g
|
||||
s|@INSTALL_PROGRAM@|${INSTALL}|g
|
||||
s|@INSTALL_DATA@|${INSTALL} -m 644|g
|
||||
s|@AWK@|mawk|g
|
||||
s|@LN_S@|ln -s|g
|
||||
s|@prefix@|/usr/local|g
|
||||
s|@exec_prefix@|${prefix}|g
|
||||
s|@bindir@|${exec_prefix}/bin|g
|
||||
s|@datadir@|${prefix}/share|g
|
||||
s|@infodir@|${prefix}/info|g
|
||||
s|@X_CFLAGS@| -I/usr/X11R6/include|g
|
||||
s|@X_LIBS@| -L/usr/X11R6/lib|g
|
||||
s|@X_EXTRA_LIBS@||g
|
||||
s|@X_PRE_LIBS@| -lSM -lICE|g
|
||||
s|@GUI_TK_INCLUDE@|-I/usr/local/lib/glib/include -I/usr/local/include -I/usr/X11R6/include|g
|
||||
s|@GUI_TK_LIBRARY@|-L/usr/local/lib -L/usr/X11R6/lib -lgtk -lgdk -lglib -lXext -lX11 -lm|g
|
||||
s|@GUI_TK_LINK@||g
|
||||
s|@OPENGL_INCLUDE@||g
|
||||
s|@OPENGL_LIBRARY@||g
|
||||
s|@OPENGL_LINK@||g
|
||||
s|@TOOLKIT@|GTK|g
|
||||
s|@TOOLKIT_DEF@|__GTK__|g
|
||||
s|@THREADS@|NONE|g
|
||||
s|@THREADS_LINK@||g
|
||||
s|@WXSTRING@|@WXSTRING@|g
|
||||
s|@TYPETREE@|NONE|g
|
||||
s|@METAFILE@|NONE|g
|
||||
s|@POSTSCRIPTDC@|POSTSCRIPTDC|g
|
||||
s|@WXGRAPH@|NONE|g
|
||||
s|@WXTREE@|NONE|g
|
||||
s|@DOCVIEW@|DOCVIEW|g
|
||||
s|@FORM@|NONE|g
|
||||
s|@PRINTPREVIEW@|PRINTPREVIEW|g
|
||||
s|@IPC@|IPC|g
|
||||
s|@HELP@|NONE|g
|
||||
s|@CLIPBOARD@|NONE|g
|
||||
s|@TIMEDATE@|TIMEDATE|g
|
||||
s|@FRACTION@|FRACTION|g
|
||||
s|@PROLOGIO@|NONE|g
|
||||
s|@PROLOGIOSRC@|NONE|g
|
||||
s|@ENHDIALOGBOX@|NONE|g
|
||||
s|@GAUGE@|GAUGE|g
|
||||
s|@GLCANVAS@|NONE|g
|
||||
s|@LAYOUT@|@LAYOUT@|g
|
||||
s|@WXRESOURCES@|WXRESOURCES|g
|
||||
s|@XRESOURCES@|XRESOURCES|g
|
||||
s|@SCROLLBAR@|SCROLLBAR|g
|
||||
s|@STATICITEMS@|@STATICITEMS@|g
|
||||
s|@TOOLBAR@|TOOLBAR|g
|
||||
s|@CONSTRAINTS@|CONSTRAINTS|g
|
||||
s|@RPC@|NONE|g
|
||||
s|@VIRLISTBOX@|NONE|g
|
||||
|
@ -126,6 +126,10 @@
|
||||
* Use PostScript device context
|
||||
*/
|
||||
#undef USE_POSTSCRIPT
|
||||
/*
|
||||
* Use wxConfig system
|
||||
*/
|
||||
#undef USE_WXCONFIG
|
||||
/*
|
||||
* Use the print/preview architecture
|
||||
*/
|
||||
|
@ -1,329 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tabctrl.cpp
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Created: 01/02/97
|
||||
// Id:
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "tabctrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/tabctrl.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/imaglist.h"
|
||||
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTabPage
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxTabPage: public wxObject
|
||||
{
|
||||
public:
|
||||
|
||||
int m_id;
|
||||
wxString m_text;
|
||||
int m_image;
|
||||
void *m_clientData;
|
||||
GtkNotebookPage *m_page;
|
||||
GtkWidget *m_wxwindow;
|
||||
wxList m_children;
|
||||
|
||||
wxTabPage(void)
|
||||
{
|
||||
m_id = -1;
|
||||
m_text = "";
|
||||
m_image = -1;
|
||||
m_clientData = NULL;
|
||||
m_page = NULL;
|
||||
m_wxwindow = NULL;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTabCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
BEGIN_EVENT_TABLE(wxTabCtrl, wxControl)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl,wxControl)
|
||||
|
||||
wxTabCtrl::wxTabCtrl(void)
|
||||
{
|
||||
m_imageList = NULL;
|
||||
m_pages.DeleteContents( TRUE );
|
||||
};
|
||||
|
||||
wxTabCtrl::wxTabCtrl( wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
const long style, const wxString& name )
|
||||
{
|
||||
m_imageList = NULL;
|
||||
m_pages.DeleteContents( TRUE );
|
||||
Create( parent, id, pos, size, style, name );
|
||||
};
|
||||
|
||||
wxTabCtrl::~wxTabCtrl(void)
|
||||
{
|
||||
if (m_imageList) delete m_imageList;
|
||||
DeleteAllItems();
|
||||
};
|
||||
|
||||
bool wxTabCtrl::Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
const long style, const wxString& name )
|
||||
{
|
||||
m_needParent = TRUE;
|
||||
|
||||
PreCreation( parent, id, pos, size, style, name );
|
||||
|
||||
m_widget = gtk_notebook_new();
|
||||
|
||||
PostCreation();
|
||||
|
||||
Show( TRUE );
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
int wxTabCtrl::GetSelection(void) const
|
||||
{
|
||||
return gtk_notebook_current_page( GTK_NOTEBOOK(m_widget) );
|
||||
};
|
||||
|
||||
wxImageList* wxTabCtrl::GetImageList(void) const
|
||||
{
|
||||
return m_imageList;
|
||||
};
|
||||
|
||||
int wxTabCtrl::GetItemCount(void) const
|
||||
{
|
||||
return m_pages.Number();
|
||||
};
|
||||
|
||||
bool wxTabCtrl::GetItemRect( const int WXUNUSED(item), wxRect& WXUNUSED(rect) ) const
|
||||
{
|
||||
return FALSE;
|
||||
};
|
||||
|
||||
int wxTabCtrl::GetRowCount(void) const
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
|
||||
wxString wxTabCtrl::GetItemText( const int item ) const
|
||||
{
|
||||
wxNode *node = m_pages.Nth( item );
|
||||
if (node)
|
||||
{
|
||||
wxTabPage *page = (wxTabPage*)node->Data();
|
||||
return page->m_text;
|
||||
};
|
||||
return "";
|
||||
};
|
||||
|
||||
int wxTabCtrl::GetItemImage( const int item ) const
|
||||
{
|
||||
wxNode *node = m_pages.Nth( item );
|
||||
if (node)
|
||||
{
|
||||
wxTabPage *page = (wxTabPage*)node->Data();
|
||||
return page->m_image;
|
||||
};
|
||||
return -1;
|
||||
};
|
||||
|
||||
void* wxTabCtrl::GetItemData( const int item ) const
|
||||
{
|
||||
wxNode *node = m_pages.Nth( item );
|
||||
if (node)
|
||||
{
|
||||
wxTabPage *page = (wxTabPage*)node->Data();
|
||||
return page->m_clientData;
|
||||
};
|
||||
return NULL;
|
||||
};
|
||||
|
||||
int wxTabCtrl::SetSelection( const int item )
|
||||
{
|
||||
wxTabPage *page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
page = (wxTabPage*)node->Data();
|
||||
if (page->m_id == item) break;
|
||||
page = NULL;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!page) return -1;
|
||||
|
||||
int page_num = 0;
|
||||
GList *child = GTK_NOTEBOOK(m_widget)->children;
|
||||
while (child)
|
||||
{
|
||||
if (page->m_page == (GtkNotebookPage*)child->data) break;
|
||||
page_num++;
|
||||
child = child->next;
|
||||
};
|
||||
|
||||
if (!child) return -1;
|
||||
|
||||
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page_num );
|
||||
|
||||
return item;
|
||||
};
|
||||
|
||||
void wxTabCtrl::SetImageList( wxImageList* imageList )
|
||||
{
|
||||
m_imageList = imageList;
|
||||
};
|
||||
|
||||
bool wxTabCtrl::SetItemText( const int WXUNUSED(item), const wxString& WXUNUSED(text) )
|
||||
{
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxTabCtrl::SetItemImage( const int WXUNUSED(item), const int WXUNUSED(image) )
|
||||
{
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxTabCtrl::SetItemData( const int WXUNUSED(item), void* WXUNUSED(data) )
|
||||
{
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
void wxTabCtrl::SetItemSize( const wxSize &WXUNUSED(size) )
|
||||
{
|
||||
};
|
||||
|
||||
void wxTabCtrl::SetPadding( const wxSize &WXUNUSED(padding) )
|
||||
{
|
||||
};
|
||||
|
||||
bool wxTabCtrl::DeleteAllItems(void)
|
||||
{
|
||||
wxNode *page_node = m_pages.First();
|
||||
while (page_node)
|
||||
{
|
||||
wxTabPage *page = (wxTabPage*)page_node->Data();
|
||||
|
||||
wxNode *node = page->m_children.First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *child = (wxWindow*)node->Data();
|
||||
delete child;
|
||||
|
||||
node = node->Next();
|
||||
};
|
||||
|
||||
gtk_widget_destroy( page->m_wxwindow );
|
||||
|
||||
m_pages.DeleteObject( page );
|
||||
|
||||
page_node = m_pages.First();
|
||||
};
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxTabCtrl::DeleteItem( const int item )
|
||||
{
|
||||
wxTabPage *page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
page = (wxTabPage*)node->Data();
|
||||
if (page->m_id == item) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return FALSE;
|
||||
|
||||
node = page->m_children.First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *child = (wxWindow*)node->Data();
|
||||
delete child;
|
||||
|
||||
node = node->Next();
|
||||
};
|
||||
|
||||
gtk_widget_destroy( page->m_wxwindow );
|
||||
|
||||
m_pages.DeleteObject( page );
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
int wxTabCtrl::HitTest( const wxPoint &WXUNUSED(pt), long &WXUNUSED(flags) )
|
||||
{
|
||||
return wxTAB_HITTEST_NOWHERE;
|
||||
};
|
||||
|
||||
int wxTabCtrl::InsertItem( const int item, const wxString &text, const int imageId, void* data )
|
||||
{
|
||||
wxTabPage *page = new wxTabPage;
|
||||
|
||||
page->m_text = text;
|
||||
if (page->m_text.IsNull()) page->m_text = "";
|
||||
page->m_id = item;
|
||||
page->m_image = imageId;
|
||||
page->m_clientData = data;
|
||||
|
||||
GtkWidget *label_widget = gtk_label_new( page->m_text );
|
||||
gtk_misc_set_alignment( GTK_MISC(label_widget), 0.0, 0.5 );
|
||||
|
||||
page->m_wxwindow = gtk_myfixed_new();
|
||||
gtk_widget_show( page->m_wxwindow );
|
||||
gtk_widget_set_usize( page->m_wxwindow, 100, 100 );
|
||||
|
||||
gtk_notebook_append_page( GTK_NOTEBOOK(m_widget), page->m_wxwindow, label_widget );
|
||||
|
||||
page->m_page = GTK_NOTEBOOK(m_widget)->cur_page;
|
||||
|
||||
m_pages.Append( page );
|
||||
|
||||
return item;
|
||||
};
|
||||
|
||||
void wxTabCtrl::AddChild( wxWindow *win )
|
||||
{
|
||||
GtkNotebookPage *g_page = GTK_NOTEBOOK(m_widget)->cur_page;
|
||||
|
||||
wxTabPage *page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
page = (wxTabPage*)node->Data();
|
||||
if (page->m_page == g_page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
|
||||
if (!page) wxFatalError( "wxTabCtrl error" );
|
||||
|
||||
gtk_myfixed_put( GTK_MYFIXED(page->m_wxwindow), win->m_widget, win->m_x, win->m_y );
|
||||
gtk_widget_set_usize( win->m_widget, win->m_width, win->m_height );
|
||||
|
||||
page->m_children.Append( win );
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTabEvent
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent)
|
||||
|
||||
wxTabEvent::wxTabEvent( WXTYPE commandType, int id ) :
|
||||
wxCommandEvent(commandType, id)
|
||||
{
|
||||
};
|
@ -25,7 +25,7 @@
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dnd.h"
|
||||
#include "wx/mdi.h"
|
||||
#include "wx/tabctrl.h"
|
||||
#include "wx/notebook.h"
|
||||
#include "gdk/gdkkeysyms.h"
|
||||
#include <math.h>
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
@ -1415,9 +1415,9 @@ void wxWindow::AddChild( wxWindow *child )
|
||||
};
|
||||
};
|
||||
|
||||
if (IsKindOf(CLASSINFO(wxTabCtrl)))
|
||||
if (IsKindOf(CLASSINFO(wxNotebook)))
|
||||
{
|
||||
wxTabCtrl *tab = (wxTabCtrl*)this;
|
||||
wxNotebook *tab = (wxNotebook*)this;
|
||||
tab->AddChild( child );
|
||||
return;
|
||||
};
|
||||
|
384
src/gtk1/notebook.cpp
Normal file
384
src/gtk1/notebook.cpp
Normal file
@ -0,0 +1,384 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: notebook.cpp
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Created: 01/02/97
|
||||
// Id:
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "notebook.h"
|
||||
#endif
|
||||
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/panel.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/imaglist.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxNotebookPage
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxNotebookPage: public wxObject
|
||||
{
|
||||
public:
|
||||
|
||||
int m_id;
|
||||
wxString m_text;
|
||||
int m_image;
|
||||
void *m_clientData;
|
||||
GtkNotebookPage *m_page;
|
||||
wxPanel *m_clientPanel;
|
||||
|
||||
wxNotebookPage(void)
|
||||
{
|
||||
m_id = -1;
|
||||
m_text = "";
|
||||
m_image = -1;
|
||||
m_clientData = NULL;
|
||||
m_page = NULL;
|
||||
m_clientPanel = NULL;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxNotebook
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxNotebook,wxControl)
|
||||
|
||||
wxNotebook::wxNotebook(void)
|
||||
{
|
||||
m_imageList = NULL;
|
||||
m_frame = NULL;
|
||||
m_pages.DeleteContents( TRUE );
|
||||
};
|
||||
|
||||
wxNotebook::wxNotebook( wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
const long style, const wxString& name )
|
||||
{
|
||||
m_imageList = NULL;
|
||||
m_frame = NULL;
|
||||
m_pages.DeleteContents( TRUE );
|
||||
Create( parent, id, pos, size, style, name );
|
||||
};
|
||||
|
||||
wxNotebook::~wxNotebook(void)
|
||||
{
|
||||
if (m_imageList) delete m_imageList;
|
||||
DeleteAllPages();
|
||||
};
|
||||
|
||||
bool wxNotebook::Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
const long style, const wxString& name )
|
||||
{
|
||||
m_needParent = TRUE;
|
||||
|
||||
PreCreation( parent, id, pos, size, style, name );
|
||||
|
||||
m_widget = gtk_notebook_new();
|
||||
|
||||
PostCreation();
|
||||
|
||||
Show( TRUE );
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
int wxNotebook::GetSelection(void) const
|
||||
{
|
||||
if (m_pages.Number() == 0) return -1;
|
||||
|
||||
GtkNotebookPage *g_page = GTK_NOTEBOOK(m_widget)->cur_page;
|
||||
|
||||
wxNotebookPage *page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
page = (wxNotebookPage*)node->Data();
|
||||
if (page->m_page == g_page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
|
||||
if (!node) wxFatalError( "Notebook error." );
|
||||
|
||||
return page->m_id;
|
||||
};
|
||||
|
||||
wxImageList* wxNotebook::GetImageList(void) const
|
||||
{
|
||||
return m_imageList;
|
||||
};
|
||||
|
||||
int wxNotebook::GetPageCount(void) const
|
||||
{
|
||||
return m_pages.Number();
|
||||
};
|
||||
|
||||
int wxNotebook::GetRowCount(void) const
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
|
||||
wxString wxNotebook::GetPageText( const int page ) const
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return "";
|
||||
|
||||
return nb_page->m_text;
|
||||
};
|
||||
|
||||
int wxNotebook::GetPageImage( const int page ) const
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return -1;
|
||||
|
||||
return nb_page->m_image;
|
||||
};
|
||||
|
||||
void* wxNotebook::GetPageData( const int page ) const
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return NULL;
|
||||
|
||||
return nb_page->m_clientData;
|
||||
};
|
||||
|
||||
int wxNotebook::SetSelection( const int page )
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return -1;
|
||||
|
||||
int page_num = 0;
|
||||
GList *child = GTK_NOTEBOOK(m_widget)->children;
|
||||
while (child)
|
||||
{
|
||||
if (nb_page->m_page == (GtkNotebookPage*)child->data) break;
|
||||
page_num++;
|
||||
child = child->next;
|
||||
};
|
||||
|
||||
if (!child) return -1;
|
||||
|
||||
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page_num );
|
||||
|
||||
return page;
|
||||
};
|
||||
|
||||
void wxNotebook::SetImageList( wxImageList* imageList )
|
||||
{
|
||||
m_imageList = imageList;
|
||||
};
|
||||
|
||||
bool wxNotebook::SetPageText( const int page, const wxString &text )
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return FALSE;
|
||||
|
||||
nb_page->m_text = text;
|
||||
|
||||
// recreate
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxNotebook::SetPageImage( const int page, const int image )
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return FALSE;
|
||||
|
||||
nb_page->m_image = image;
|
||||
|
||||
// recreate
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxNotebook::SetPageData( const int page, void* data )
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return FALSE;
|
||||
|
||||
nb_page->m_clientData = data;
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
|
||||
{
|
||||
};
|
||||
|
||||
void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) )
|
||||
{
|
||||
// what's this ?
|
||||
};
|
||||
|
||||
bool wxNotebook::DeleteAllPages(void)
|
||||
{
|
||||
wxNode *page_node = m_pages.First();
|
||||
while (page_node)
|
||||
{
|
||||
wxNotebookPage *page = (wxNotebookPage*)page_node->Data();
|
||||
|
||||
DeletePage( page->m_id );
|
||||
|
||||
page_node = m_pages.First();
|
||||
};
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxNotebook::DeletePage( const int page )
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return FALSE;
|
||||
|
||||
int page_num = 0;
|
||||
GList *child = GTK_NOTEBOOK(m_widget)->children;
|
||||
while (child)
|
||||
{
|
||||
if (nb_page->m_page == (GtkNotebookPage*)child->data) break;
|
||||
page_num++;
|
||||
child = child->next;
|
||||
};
|
||||
|
||||
if (!child) wxFatalError( "Notebook delete error" );;
|
||||
|
||||
gtk_notebook_remove_page( GTK_NOTEBOOK(m_widget), page_num );
|
||||
|
||||
m_pages.DeleteObject( nb_page );
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
wxPanel *wxNotebook::CreatePage( const int item, const wxString &text, const int imageId, void* data )
|
||||
{
|
||||
wxNotebookPage *page = new wxNotebookPage;
|
||||
|
||||
page->m_text = text;
|
||||
if (page->m_text.IsNull()) page->m_text = "";
|
||||
page->m_id = item;
|
||||
page->m_image = imageId;
|
||||
page->m_clientData = data;
|
||||
|
||||
m_frame = gtk_label_new( page->m_text );
|
||||
gtk_misc_set_alignment( GTK_MISC(m_frame), 0.0, 0.5 );
|
||||
|
||||
page->m_clientPanel = new wxPanel( this, -1, wxPoint(0,0), wxSize(100,100) );
|
||||
|
||||
m_frame = NULL;
|
||||
|
||||
page->m_page = GTK_NOTEBOOK(m_widget)->cur_page;
|
||||
|
||||
m_pages.Append( page );
|
||||
|
||||
return page->m_clientPanel;
|
||||
};
|
||||
|
||||
wxPanel *wxNotebook::GetPanel( const int page )
|
||||
{
|
||||
wxNotebookPage *nb_page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
nb_page = (wxNotebookPage*)node->Data();
|
||||
if (nb_page->m_id == page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return NULL;
|
||||
|
||||
return nb_page->m_clientPanel;
|
||||
};
|
||||
|
||||
void wxNotebook::AddChild( wxWindow *win )
|
||||
{
|
||||
if (!m_frame) wxFatalError( "Notebook::Addchild() must not be called directly." );
|
||||
|
||||
gtk_notebook_append_page( GTK_NOTEBOOK(m_widget), win->m_widget, m_frame );
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTabEvent
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent)
|
||||
|
||||
wxTabEvent::wxTabEvent( WXTYPE commandType, int id ) :
|
||||
wxCommandEvent(commandType, id)
|
||||
{
|
||||
};
|
||||
|
@ -1,123 +0,0 @@
|
||||
# Makefile for Autoconf.
|
||||
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program 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 General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
#### Start of system configuration section. ####
|
||||
|
||||
GLOBAL_LIB_DIR = $(WXBASEDIR)/lib/$(OS)
|
||||
GLOBAL_BIN_DIR = $(WXBASEDIR)/bin/$(OS)
|
||||
|
||||
# define toolkit to use
|
||||
TOOLKIT_DEF = -D__GTK__
|
||||
|
||||
# general compiler stuff
|
||||
OPTIMISE = -O2
|
||||
PROFILE =
|
||||
DEBUG =
|
||||
|
||||
# c-compiler stuff
|
||||
CC = gcc
|
||||
CFLAGS = -Wall $(OPTIMISE) $(PROFILE) $(DEBUG)
|
||||
CPP = gcc -E
|
||||
|
||||
# c++-compiler stuff
|
||||
CXX = c++
|
||||
CXXFLAGS = -Wall $(OPTIMISE) $(PROFILE) $(DEBUG)
|
||||
CXXCPP = c++ -E
|
||||
|
||||
# shared compile stuff
|
||||
PICFLAGS =
|
||||
CREATE_SHARED =
|
||||
|
||||
# other stuff
|
||||
RM = rm -f
|
||||
LEX = flex
|
||||
LEXLIB = -lfl
|
||||
YACC = bison -y
|
||||
RANLIB = ranlib
|
||||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
AWK = mawk
|
||||
LN_S = ln -s
|
||||
CJPEG_PROG =
|
||||
CONVERT_PATH = /usr/bin/X11
|
||||
CONVERT_PROG = /usr/bin/X11/convert
|
||||
DJPEG_PROG =
|
||||
GIFTOPNM_PROG =
|
||||
NETPBM_PATH =
|
||||
|
||||
prefix = /usr/local
|
||||
exec_prefix = ${prefix}
|
||||
|
||||
# Directory in which to install scripts.
|
||||
#bindir = ${exec_prefix}/bin
|
||||
|
||||
# Directory in which to install library files.
|
||||
datadir = ${prefix}/share
|
||||
acdatadir = $(datadir)/autoconf
|
||||
|
||||
# Directory in which to install documentation info files.
|
||||
infodir = ${prefix}/info
|
||||
|
||||
X_CFLAGS = -I/usr/X11R6/include
|
||||
X_LIBS = -L/usr/X11R6/lib
|
||||
X_EXTRA_LIBS =
|
||||
X_PRE_LIBS = -lSM -lICE
|
||||
|
||||
GUI_TK_INCLUDE = -I/usr/local/lib/glib/include -I/usr/local/include -I/usr/X11R6/include
|
||||
GUI_TK_LIBRARY = -L/usr/local/lib -L/usr/X11R6/lib -lgtk -lgdk -lglib -lXext -lX11 -lm
|
||||
GUI_TK_LINK =
|
||||
|
||||
OPENGL_INCLUDE =
|
||||
OPENGL_LIBRARY =
|
||||
OPENGL_LINK =
|
||||
|
||||
THREADS_LINK =
|
||||
|
||||
# INCLUDES
|
||||
WX_INCLUDES = \
|
||||
$(TOOLKIT_DEF) \
|
||||
-I. \
|
||||
-I.. \
|
||||
-I$(WXBASEDIR)/include \
|
||||
-I$(WXBASEDIR)/src/png \
|
||||
-I$(WXBASEDIR)/src/zlib \
|
||||
-I$(WXBASEDIR)/src/gdk_imlib \
|
||||
$(GUI_TK_INCLUDE) \
|
||||
$(OPENGL_INCLUDE) \
|
||||
$(X_CFLAGS)
|
||||
|
||||
WX_LIBS = -L$(GLOBAL_LIB_DIR) -lwx_gtk
|
||||
|
||||
OPENGL_LIBS = $(OPENGL_LIBRARY) $(OPENGL_LINK)
|
||||
|
||||
GUI_TK_LIBS = $(GUI_TK_LIBRARY) $(GUI_TK_LINK)
|
||||
|
||||
LINK = $(CXX) -o $@
|
||||
LINK_LIBS= \
|
||||
$(WX_LIBS) \
|
||||
$(GUI_TK_LIBS) \
|
||||
$(X_EXTRA_LIBS) \
|
||||
$(X_PRE_LIBS)
|
||||
|
||||
# $(X_LIBS) -lX11 -lXext -lm gtk-config does this for me
|
||||
|
||||
# Don't include $(OPENGL_LIBS) or $(THREADS_LINK) in LINK_LIBS; they
|
||||
# can be conveniently added to BIN_LINK in Makefile.in.
|
||||
|
||||
#### End of system configuration section. ####
|
@ -1,70 +0,0 @@
|
||||
s|@OS@|linux|g
|
||||
s|@WXBASEDIR@|/home/karl/cvs/wxWindows|g
|
||||
s|@PROFILE@||g
|
||||
s|@DEBUG@||g
|
||||
s|@OPTIMISE@|-O2 |g
|
||||
s|@CC@|gcc|g
|
||||
s|@CFLAGS@| -Wall|g
|
||||
s|@CPP@|gcc -E|g
|
||||
s|@CXX@|c++|g
|
||||
s|@CXXFLAGS@| -Wall|g
|
||||
s|@CXXCPP@|c++ -E|g
|
||||
s|@PICFLAGS@||g
|
||||
s|@CREATE_SHARED@||g
|
||||
s|@LEX@|flex|g
|
||||
s|@LEXLIB@|-lfl|g
|
||||
s|@YACC@|bison -y|g
|
||||
s|@RANLIB@|ranlib|g
|
||||
s|@INSTALL@|/usr/bin/install -c|g
|
||||
s|@INSTALL_PROGRAM@|${INSTALL}|g
|
||||
s|@INSTALL_DATA@|${INSTALL} -m 644|g
|
||||
s|@AWK@|mawk|g
|
||||
s|@LN_S@|ln -s|g
|
||||
s|@prefix@|/usr/local|g
|
||||
s|@exec_prefix@|${prefix}|g
|
||||
s|@bindir@|${exec_prefix}/bin|g
|
||||
s|@datadir@|${prefix}/share|g
|
||||
s|@infodir@|${prefix}/info|g
|
||||
s|@X_CFLAGS@| -I/usr/X11R6/include|g
|
||||
s|@X_LIBS@| -L/usr/X11R6/lib|g
|
||||
s|@X_EXTRA_LIBS@||g
|
||||
s|@X_PRE_LIBS@| -lSM -lICE|g
|
||||
s|@GUI_TK_INCLUDE@|-I/usr/local/lib/glib/include -I/usr/local/include -I/usr/X11R6/include|g
|
||||
s|@GUI_TK_LIBRARY@|-L/usr/local/lib -L/usr/X11R6/lib -lgtk -lgdk -lglib -lXext -lX11 -lm|g
|
||||
s|@GUI_TK_LINK@||g
|
||||
s|@OPENGL_INCLUDE@||g
|
||||
s|@OPENGL_LIBRARY@||g
|
||||
s|@OPENGL_LINK@||g
|
||||
s|@TOOLKIT@|GTK|g
|
||||
s|@TOOLKIT_DEF@|__GTK__|g
|
||||
s|@THREADS@|NONE|g
|
||||
s|@THREADS_LINK@||g
|
||||
s|@WXSTRING@|@WXSTRING@|g
|
||||
s|@TYPETREE@|NONE|g
|
||||
s|@METAFILE@|NONE|g
|
||||
s|@POSTSCRIPTDC@|POSTSCRIPTDC|g
|
||||
s|@WXGRAPH@|NONE|g
|
||||
s|@WXTREE@|NONE|g
|
||||
s|@DOCVIEW@|DOCVIEW|g
|
||||
s|@FORM@|NONE|g
|
||||
s|@PRINTPREVIEW@|PRINTPREVIEW|g
|
||||
s|@IPC@|IPC|g
|
||||
s|@HELP@|NONE|g
|
||||
s|@CLIPBOARD@|NONE|g
|
||||
s|@TIMEDATE@|TIMEDATE|g
|
||||
s|@FRACTION@|FRACTION|g
|
||||
s|@PROLOGIO@|NONE|g
|
||||
s|@PROLOGIOSRC@|NONE|g
|
||||
s|@ENHDIALOGBOX@|NONE|g
|
||||
s|@GAUGE@|GAUGE|g
|
||||
s|@GLCANVAS@|NONE|g
|
||||
s|@LAYOUT@|@LAYOUT@|g
|
||||
s|@WXRESOURCES@|WXRESOURCES|g
|
||||
s|@XRESOURCES@|XRESOURCES|g
|
||||
s|@SCROLLBAR@|SCROLLBAR|g
|
||||
s|@STATICITEMS@|@STATICITEMS@|g
|
||||
s|@TOOLBAR@|TOOLBAR|g
|
||||
s|@CONSTRAINTS@|CONSTRAINTS|g
|
||||
s|@RPC@|NONE|g
|
||||
s|@VIRLISTBOX@|NONE|g
|
||||
|
@ -126,6 +126,10 @@
|
||||
* Use PostScript device context
|
||||
*/
|
||||
#undef USE_POSTSCRIPT
|
||||
/*
|
||||
* Use wxConfig system
|
||||
*/
|
||||
#undef USE_WXCONFIG
|
||||
/*
|
||||
* Use the print/preview architecture
|
||||
*/
|
||||
|
@ -1,329 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tabctrl.cpp
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Created: 01/02/97
|
||||
// Id:
|
||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "tabctrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/tabctrl.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/imaglist.h"
|
||||
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTabPage
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxTabPage: public wxObject
|
||||
{
|
||||
public:
|
||||
|
||||
int m_id;
|
||||
wxString m_text;
|
||||
int m_image;
|
||||
void *m_clientData;
|
||||
GtkNotebookPage *m_page;
|
||||
GtkWidget *m_wxwindow;
|
||||
wxList m_children;
|
||||
|
||||
wxTabPage(void)
|
||||
{
|
||||
m_id = -1;
|
||||
m_text = "";
|
||||
m_image = -1;
|
||||
m_clientData = NULL;
|
||||
m_page = NULL;
|
||||
m_wxwindow = NULL;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTabCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
BEGIN_EVENT_TABLE(wxTabCtrl, wxControl)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl,wxControl)
|
||||
|
||||
wxTabCtrl::wxTabCtrl(void)
|
||||
{
|
||||
m_imageList = NULL;
|
||||
m_pages.DeleteContents( TRUE );
|
||||
};
|
||||
|
||||
wxTabCtrl::wxTabCtrl( wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
const long style, const wxString& name )
|
||||
{
|
||||
m_imageList = NULL;
|
||||
m_pages.DeleteContents( TRUE );
|
||||
Create( parent, id, pos, size, style, name );
|
||||
};
|
||||
|
||||
wxTabCtrl::~wxTabCtrl(void)
|
||||
{
|
||||
if (m_imageList) delete m_imageList;
|
||||
DeleteAllItems();
|
||||
};
|
||||
|
||||
bool wxTabCtrl::Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
const long style, const wxString& name )
|
||||
{
|
||||
m_needParent = TRUE;
|
||||
|
||||
PreCreation( parent, id, pos, size, style, name );
|
||||
|
||||
m_widget = gtk_notebook_new();
|
||||
|
||||
PostCreation();
|
||||
|
||||
Show( TRUE );
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
int wxTabCtrl::GetSelection(void) const
|
||||
{
|
||||
return gtk_notebook_current_page( GTK_NOTEBOOK(m_widget) );
|
||||
};
|
||||
|
||||
wxImageList* wxTabCtrl::GetImageList(void) const
|
||||
{
|
||||
return m_imageList;
|
||||
};
|
||||
|
||||
int wxTabCtrl::GetItemCount(void) const
|
||||
{
|
||||
return m_pages.Number();
|
||||
};
|
||||
|
||||
bool wxTabCtrl::GetItemRect( const int WXUNUSED(item), wxRect& WXUNUSED(rect) ) const
|
||||
{
|
||||
return FALSE;
|
||||
};
|
||||
|
||||
int wxTabCtrl::GetRowCount(void) const
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
|
||||
wxString wxTabCtrl::GetItemText( const int item ) const
|
||||
{
|
||||
wxNode *node = m_pages.Nth( item );
|
||||
if (node)
|
||||
{
|
||||
wxTabPage *page = (wxTabPage*)node->Data();
|
||||
return page->m_text;
|
||||
};
|
||||
return "";
|
||||
};
|
||||
|
||||
int wxTabCtrl::GetItemImage( const int item ) const
|
||||
{
|
||||
wxNode *node = m_pages.Nth( item );
|
||||
if (node)
|
||||
{
|
||||
wxTabPage *page = (wxTabPage*)node->Data();
|
||||
return page->m_image;
|
||||
};
|
||||
return -1;
|
||||
};
|
||||
|
||||
void* wxTabCtrl::GetItemData( const int item ) const
|
||||
{
|
||||
wxNode *node = m_pages.Nth( item );
|
||||
if (node)
|
||||
{
|
||||
wxTabPage *page = (wxTabPage*)node->Data();
|
||||
return page->m_clientData;
|
||||
};
|
||||
return NULL;
|
||||
};
|
||||
|
||||
int wxTabCtrl::SetSelection( const int item )
|
||||
{
|
||||
wxTabPage *page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
page = (wxTabPage*)node->Data();
|
||||
if (page->m_id == item) break;
|
||||
page = NULL;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!page) return -1;
|
||||
|
||||
int page_num = 0;
|
||||
GList *child = GTK_NOTEBOOK(m_widget)->children;
|
||||
while (child)
|
||||
{
|
||||
if (page->m_page == (GtkNotebookPage*)child->data) break;
|
||||
page_num++;
|
||||
child = child->next;
|
||||
};
|
||||
|
||||
if (!child) return -1;
|
||||
|
||||
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page_num );
|
||||
|
||||
return item;
|
||||
};
|
||||
|
||||
void wxTabCtrl::SetImageList( wxImageList* imageList )
|
||||
{
|
||||
m_imageList = imageList;
|
||||
};
|
||||
|
||||
bool wxTabCtrl::SetItemText( const int WXUNUSED(item), const wxString& WXUNUSED(text) )
|
||||
{
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxTabCtrl::SetItemImage( const int WXUNUSED(item), const int WXUNUSED(image) )
|
||||
{
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxTabCtrl::SetItemData( const int WXUNUSED(item), void* WXUNUSED(data) )
|
||||
{
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
void wxTabCtrl::SetItemSize( const wxSize &WXUNUSED(size) )
|
||||
{
|
||||
};
|
||||
|
||||
void wxTabCtrl::SetPadding( const wxSize &WXUNUSED(padding) )
|
||||
{
|
||||
};
|
||||
|
||||
bool wxTabCtrl::DeleteAllItems(void)
|
||||
{
|
||||
wxNode *page_node = m_pages.First();
|
||||
while (page_node)
|
||||
{
|
||||
wxTabPage *page = (wxTabPage*)page_node->Data();
|
||||
|
||||
wxNode *node = page->m_children.First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *child = (wxWindow*)node->Data();
|
||||
delete child;
|
||||
|
||||
node = node->Next();
|
||||
};
|
||||
|
||||
gtk_widget_destroy( page->m_wxwindow );
|
||||
|
||||
m_pages.DeleteObject( page );
|
||||
|
||||
page_node = m_pages.First();
|
||||
};
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
bool wxTabCtrl::DeleteItem( const int item )
|
||||
{
|
||||
wxTabPage *page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
page = (wxTabPage*)node->Data();
|
||||
if (page->m_id == item) break;
|
||||
node = node->Next();
|
||||
};
|
||||
if (!node) return FALSE;
|
||||
|
||||
node = page->m_children.First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *child = (wxWindow*)node->Data();
|
||||
delete child;
|
||||
|
||||
node = node->Next();
|
||||
};
|
||||
|
||||
gtk_widget_destroy( page->m_wxwindow );
|
||||
|
||||
m_pages.DeleteObject( page );
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
|
||||
int wxTabCtrl::HitTest( const wxPoint &WXUNUSED(pt), long &WXUNUSED(flags) )
|
||||
{
|
||||
return wxTAB_HITTEST_NOWHERE;
|
||||
};
|
||||
|
||||
int wxTabCtrl::InsertItem( const int item, const wxString &text, const int imageId, void* data )
|
||||
{
|
||||
wxTabPage *page = new wxTabPage;
|
||||
|
||||
page->m_text = text;
|
||||
if (page->m_text.IsNull()) page->m_text = "";
|
||||
page->m_id = item;
|
||||
page->m_image = imageId;
|
||||
page->m_clientData = data;
|
||||
|
||||
GtkWidget *label_widget = gtk_label_new( page->m_text );
|
||||
gtk_misc_set_alignment( GTK_MISC(label_widget), 0.0, 0.5 );
|
||||
|
||||
page->m_wxwindow = gtk_myfixed_new();
|
||||
gtk_widget_show( page->m_wxwindow );
|
||||
gtk_widget_set_usize( page->m_wxwindow, 100, 100 );
|
||||
|
||||
gtk_notebook_append_page( GTK_NOTEBOOK(m_widget), page->m_wxwindow, label_widget );
|
||||
|
||||
page->m_page = GTK_NOTEBOOK(m_widget)->cur_page;
|
||||
|
||||
m_pages.Append( page );
|
||||
|
||||
return item;
|
||||
};
|
||||
|
||||
void wxTabCtrl::AddChild( wxWindow *win )
|
||||
{
|
||||
GtkNotebookPage *g_page = GTK_NOTEBOOK(m_widget)->cur_page;
|
||||
|
||||
wxTabPage *page = NULL;
|
||||
|
||||
wxNode *node = m_pages.First();
|
||||
while (node)
|
||||
{
|
||||
page = (wxTabPage*)node->Data();
|
||||
if (page->m_page == g_page) break;
|
||||
node = node->Next();
|
||||
};
|
||||
|
||||
if (!page) wxFatalError( "wxTabCtrl error" );
|
||||
|
||||
gtk_myfixed_put( GTK_MYFIXED(page->m_wxwindow), win->m_widget, win->m_x, win->m_y );
|
||||
gtk_widget_set_usize( win->m_widget, win->m_width, win->m_height );
|
||||
|
||||
page->m_children.Append( win );
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTabEvent
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent)
|
||||
|
||||
wxTabEvent::wxTabEvent( WXTYPE commandType, int id ) :
|
||||
wxCommandEvent(commandType, id)
|
||||
{
|
||||
};
|
@ -25,7 +25,7 @@
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dnd.h"
|
||||
#include "wx/mdi.h"
|
||||
#include "wx/tabctrl.h"
|
||||
#include "wx/notebook.h"
|
||||
#include "gdk/gdkkeysyms.h"
|
||||
#include <math.h>
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
@ -1415,9 +1415,9 @@ void wxWindow::AddChild( wxWindow *child )
|
||||
};
|
||||
};
|
||||
|
||||
if (IsKindOf(CLASSINFO(wxTabCtrl)))
|
||||
if (IsKindOf(CLASSINFO(wxNotebook)))
|
||||
{
|
||||
wxTabCtrl *tab = (wxTabCtrl*)this;
|
||||
wxNotebook *tab = (wxNotebook*)this;
|
||||
tab->AddChild( child );
|
||||
return;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user