--- /dev/null
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
// Load from a resource
# define wxICON(X) wxIcon("" #X "")
-#elif defined(__WXGTK__)
+#elif defined(__WXGTK__) || defined(__WXMOTIF__)
// Initialize from an included XPM
-# define wxICON(X) wxIcon(X##_xpm)
+# define wxICON(X) wxIcon( (const char**) X##_xpm )
#else
// This will usually mean something on any platform
wxBitmap( int width, int height, int depth = -1 );
wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const wxImage &image );
+ wxBitmap( const char **bits );
wxBitmap( char **bits );
wxBitmap( const wxBitmap& bmp );
wxBitmap( const wxBitmap* bmp );
void OnApply( wxCommandEvent &event );
void OnCancel( wxCommandEvent &event );
void OnOK( wxCommandEvent &event );
- void OnPaint(wxPaintEvent& event);
+ void OnPaint( wxPaintEvent& event );
+ void OnSize( wxSizeEvent &event );
/*
void OnCharHook( wxKeyEvent& event );
*/
// implementation
+ virtual void GtkOnSize( int x, int y, int width, int height );
+
bool m_modalShowing;
wxString m_title;
wxIcon m_icon;
public:
wxIcon(void);
- wxIcon(const wxIcon& icon);
- wxIcon(const wxIcon* icon);
+ wxIcon( const wxIcon& icon);
+ wxIcon( const wxIcon* icon);
+ wxIcon( const char **bits, int width=-1, int height=-1 );
wxIcon( char **bits, int width=-1, int height=-1 );
wxIcon& operator = (const wxIcon& icon);
wxBitmap( int width, int height, int depth = -1 );
wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const wxImage &image );
+ wxBitmap( const char **bits );
wxBitmap( char **bits );
wxBitmap( const wxBitmap& bmp );
wxBitmap( const wxBitmap* bmp );
void OnApply( wxCommandEvent &event );
void OnCancel( wxCommandEvent &event );
void OnOK( wxCommandEvent &event );
- void OnPaint(wxPaintEvent& event);
+ void OnPaint( wxPaintEvent& event );
+ void OnSize( wxSizeEvent &event );
/*
void OnCharHook( wxKeyEvent& event );
*/
// implementation
+ virtual void GtkOnSize( int x, int y, int width, int height );
+
bool m_modalShowing;
wxString m_title;
wxIcon m_icon;
public:
wxIcon(void);
- wxIcon(const wxIcon& icon);
- wxIcon(const wxIcon* icon);
+ wxIcon( const wxIcon& icon);
+ wxIcon( const wxIcon* icon);
+ wxIcon( const char **bits, int width=-1, int height=-1 );
wxIcon( char **bits, int width=-1, int height=-1 );
wxIcon& operator = (const wxIcon& icon);
--- /dev/null
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "Controls wxWindows App", 50, 50, 530, 420 );
// Give it an icon
-#ifdef __WXMSW__
- frame->SetIcon(wxIcon("mondrian"));
-#else
- frame->SetIcon(wxIcon( mondrian_xpm ));
-#endif
+ // The wxICON() macros loads an icon from a resource under Windows
+ // and uses an #included XPM image under GTK+ and Motif
+
+ frame->SetIcon( wxICON(mondrian) );
wxMenu *file_menu = new wxMenu;
#else
wxImageList *imagelist = new wxImageList(32, 32);
- imagelist-> Add( wxBitmap( list_xpm ));
- imagelist-> Add( wxBitmap( choice_xpm ));
- imagelist-> Add( wxBitmap( combo_xpm ));
- imagelist-> Add( wxBitmap( text_xpm ));
- imagelist-> Add( wxBitmap( radio_xpm ));
- imagelist-> Add( wxBitmap( gauge_xpm ));
+ imagelist-> Add( wxBitmap( (const char**) list_xpm ));
+ imagelist-> Add( wxBitmap( (const char**) choice_xpm ));
+ imagelist-> Add( wxBitmap( (const char**) combo_xpm ));
+ imagelist-> Add( wxBitmap( (const char**) text_xpm ));
+ imagelist-> Add( wxBitmap( (const char**) radio_xpm ));
+ imagelist-> Add( wxBitmap( (const char**) gauge_xpm ));
#endif
wxButton *button = (wxButton*)NULL;
$(INSTALL_DATA) $$f $(includedir)/wx/protocol/$$f ; \
done
@echo " Moving setup.h to library path"
- @$(INSTALL) -d $(libdir)/wx/include/wx/gtk ;\
+ @cd $(WXBASEDIR)/src ; \
+ $(INSTALL) -d $(libdir)/wx/include/wx/gtk ;\
mv $(includedir)/wx/gtk/setup.h $(libdir)/wx/include/wx/gtk/setup.h ;
@echo " Copying wx-config"
- @cd $(WXBASEDIR) ; \
- $(INSTALL) -d $(bindir) ;\
+ @cd $(WXBASEDIR)/src ; \
+ $(INSTALL) -d $(bindir) ; \
rm -f $(bindir)/wx-config ; \
- $(INSTALL_PROGRAM) wx-config $(bindir)/wx-config
+ $(INSTALL_PROGRAM) $(WXBASEDIR)/wx-config $(bindir)/wx-config
@echo " Copying static library"
- @cd $(WXBASEDIR)/lib/$(OS) ; \
+ @cd $(WXBASEDIR)/src ; \
rm -f $(libdir)/$(STATIC_LIBRARY) ; \
- $(INSTALL_DATA) $(STATIC_LIBRARY) $(libdir)/$(STATIC_LIBRARY)
+ $(INSTALL_DATA) $(WXBASEDIR)/lib/$(OS)/$(STATIC_LIBRARY) $(libdir)/$(STATIC_LIBRARY)
@if test -f $(WXBASEDIR)/lib/$(OS)/$(SHARED_LIBRARY) ; then \
echo " Copying shared library" ; \
- cd $(WXBASEDIR)/lib/$(OS) ; \
+ @cd $(WXBASEDIR)/src ; \
rm -f $(libdir)/lib$(LIB_TARGET).so* ; \
- $(INSTALL_PROGRAM) $(SHARED_LIBRARY) $(libdir)/$(SHARED_LIBRARY) ; \
+ $(INSTALL_PROGRAM) $(WXBASEDIR)/lib/$(OS)/$(SHARED_LIBRARY) $(libdir)/$(SHARED_LIBRARY) ; \
$(LN_S) $(SHARED_LIBRARY) $(libdir)/lib$(LIB_TARGET).so.$(LIB_MAJOR) ; \
$(LN_S) $(SHARED_LIBRARY) $(libdir)/lib$(LIB_TARGET).so ; \
echo " " ; \
#include "wx/frame.h"
#include "wx/menu.h"
+#include "wx/menuitem.h"
-// wxGTK is a special case because it doesn't use the generic wxMenuItem
-// class, but it's own (already defined in wx/menu.h) one
#ifndef __WXGTK__
- #include "wx/menuitem.h"
-#endif //WXGTK
-
void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) )
{
DoMenuUpdates();
}
+#endif
// update all menus
void wxFrame::DoMenuUpdates()
"Forgot to use wxResourceLoadIconData?"), (const char*) name);
return (wxIcon *) NULL;
}
- return wxIcon((char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3());
+ return wxIcon((const char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3());
#else
wxLogWarning(_("No XBM facility available!"));
#endif
common/framecmn.cpp \
common/stream.cpp \
common/datstrm.cpp \
- common/wfstream.cpp \
common/mstream.cpp \
common/zstream.cpp \
common/objstrm.cpp \
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
+wxBitmap::wxBitmap( const char **bits )
+{
+ wxCHECK_RET( bits != NULL, "invalid bitmap data" )
+
+ m_refData = new wxBitmapRefData();
+
+ GdkBitmap *mask = (GdkBitmap*) NULL;
+ GdkWindow *parent = (GdkWindow*) &gdk_root_parent;
+
+ M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( parent, &mask, NULL, (gchar **) bits );
+
+ if (mask)
+ {
+ M_BMPDATA->m_mask = new wxMask();
+ M_BMPDATA->m_mask->m_bitmap = mask;
+ }
+
+ gdk_window_get_size( M_BMPDATA->m_pixmap, &(M_BMPDATA->m_width), &(M_BMPDATA->m_height) );
+
+ M_BMPDATA->m_bpp = gdk_window_get_visual( parent )->depth; // ?
+ if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
+}
+
wxBitmap::wxBitmap( char **bits )
{
wxCHECK_RET( bits != NULL, "invalid bitmap data" )
return TRUE;
}
+//-----------------------------------------------------------------------------
+// "size_allocate"
+//-----------------------------------------------------------------------------
+
+static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxDialog *win )
+{
+ if (!win->HasVMT()) return;
+
+/*
+ printf( "OnDialogResize from " );
+ if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
+ printf( win->GetClassInfo()->GetClassName() );
+ printf( ".\n" );
+*/
+
+ win->GtkOnSize( alloc->x, alloc->y, alloc->width, alloc->height );
+}
+
//-----------------------------------------------------------------------------
// wxDialog
//-----------------------------------------------------------------------------
EVT_BUTTON (wxID_OK, wxDialog::OnOK)
EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel)
EVT_BUTTON (wxID_APPLY, wxDialog::OnApply)
+ EVT_SIZE (wxDialog::OnSize)
EVT_CLOSE (wxDialog::OnCloseWindow)
END_EVENT_TABLE()
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
GTK_SIGNAL_FUNC(gtk_dialog_delete_callback), (gpointer)this );
+ gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
+ GTK_SIGNAL_FUNC(gtk_dialog_size_callback), (gpointer)this );
+
m_wxwindow = gtk_myfixed_new();
gtk_widget_show( m_wxwindow );
GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
}
}
+void wxDialog::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height )
+{
+ // due to a bug in gtk, x,y are always 0
+ // m_x = x;
+ // m_y = y;
+
+ if ((m_height == height) && (m_width == width) &&
+ (m_sizeSet)) return;
+ if (!m_wxwindow) return;
+
+ m_width = width;
+ m_height = height;
+
+ if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth;
+ if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight;
+ if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_minWidth;
+ if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_minHeight;
+
+ gtk_widget_set_usize( m_widget, m_width, m_height );
+
+ m_sizeSet = TRUE;
+
+ wxSizeEvent event( wxSize(m_width,m_height), GetId() );
+ event.SetEventObject( this );
+ GetEventHandler()->ProcessEvent( event );
+}
+
+void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) )
+{
+ wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+
+ if (GetAutoLayout())
+ {
+ Layout();
+ }
+ else
+ {
+ // no child: go out !
+ if (!GetChildren()->First()) return;
+
+ // do we have exactly one child?
+ wxWindow *child = (wxWindow *) NULL;
+ for(wxNode *node = GetChildren()->First(); node; node = node->Next())
+ {
+ wxWindow *win = (wxWindow *)node->Data();
+ if (!IS_KIND_OF(win,wxFrame) && !IS_KIND_OF(win,wxDialog))
+ {
+ // it's the second one: do nothing
+ if (child) return;
+ child = win;
+ }
+ }
+
+ // yes: set it's size to fill all the frame
+ int client_x, client_y;
+ GetClientSize( &client_x, &client_y );
+ child->SetSize( 1, 1, client_x-2, client_y);
+ }
+}
+
void wxDialog::SetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
- ProcessEvent( event );
+ GetEventHandler()->ProcessEvent( event );
m_resizing = FALSE;
}
static void gtk_frame_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxFrame *win )
{
if (!win->HasVMT()) return;
-
+
/*
printf( "OnFrameResize from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
- win->GtkOnSize( alloc->x, alloc->y, alloc->width, alloc->height );
+
+ if ((win->m_width != alloc->width) || (win->m_height != alloc->height))
+ {
+ win->m_sizeSet = FALSE;
+ win->m_width = alloc->width;
+ win->m_height = alloc->height;
+ }
}
//-----------------------------------------------------------------------------
if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP;
m_widget = gtk_window_new( win_type );
+
if ((size.x != -1) && (size.y != -1))
gtk_widget_set_usize( m_widget, m_width, m_height );
if ((pos.x != -1) && (pos.y != -1))
if (show)
{
+/*
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
m_sizeSet = FALSE;
- ProcessEvent( event );
+ GetEventHandler()->ProcessEvent( event );
+*/
}
return wxWindow::Show( show );
}
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
- ProcessEvent( event );
+ GetEventHandler()->ProcessEvent( event );
m_resizing = FALSE;
}
// m_x = x;
// m_y = y;
- if ((m_height == height) && (m_width == width) &&
- (m_sizeSet)) return;
+ if (m_resizing) return;
+ m_resizing = TRUE;
+
if (!m_wxwindow) return;
m_width = width;
if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_minWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_minHeight;
- gtk_widget_set_usize( m_widget, m_width, m_height );
-
+// gtk_widget_set_usize( m_widget, m_width, m_height );
+
// This emulates the new wxMSW behaviour
if (m_frameMenuBar)
gtk_myfixed_move( GTK_MYFIXED(m_wxwindow), m_frameStatusBar->m_widget, 0, m_height-wxSTATUS_HEIGHT );
gtk_widget_set_usize( m_frameStatusBar->m_widget, m_width, wxSTATUS_HEIGHT );
}
-
+
m_sizeSet = TRUE;
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
- ProcessEvent( event );
+ GetEventHandler()->ProcessEvent( event );
+
+ m_resizing = FALSE;
+}
+
+void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) )
+{
+ if (!m_sizeSet)
+ GtkOnSize( m_x, m_y, m_width, m_height );
+
+ DoMenuUpdates();
}
void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
IMPLEMENT_DYNAMIC_CLASS(wxIcon,wxBitmap)
+wxIcon::wxIcon( const char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
+ wxBitmap( bits )
+{
+}
+
wxIcon::wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
- wxBitmap( bits )
+ wxBitmap( bits )
{
}
{
}
-wxIcon::wxIcon(const wxIcon& icon) : wxBitmap()
+wxIcon::wxIcon( const wxIcon& icon ) : wxBitmap()
{
- Ref(icon);
+ Ref(icon);
}
-wxIcon::wxIcon(const wxIcon* icon) : wxBitmap()
+wxIcon::wxIcon( const wxIcon* icon ) : wxBitmap()
{
- if (icon) Ref(*icon);
+ if (icon) Ref(*icon);
}
-wxIcon& wxIcon::operator = (const wxIcon& icon)
+wxIcon& wxIcon::operator = ( const wxIcon& icon )
{
- if (*this == icon) return (*this);
- Ref(icon);
- return *this;
+ if (*this == icon) return (*this);
+ Ref(icon);
+ return *this;
}
#include <netdb.h>
#include <signal.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xresource.h>
+
+#include "gdk/gdkx.h" // GDK_DISPLAY
#ifdef __SVR4__
#include <sys/systeminfo.h>
void wxBell(void)
{
- gdk_beep();
-};
+ gdk_beep();
+}
void wxSleep(int nSecs)
{
- sleep(nSecs);
-};
+ sleep(nSecs);
+}
int wxKill(long pid, int sig)
{
- return kill(pid, sig);
-};
+ return kill(pid, sig);
+}
void wxDisplaySize( int *width, int *height )
{
- if (width) *width = gdk_screen_width();
- if (height) *height = gdk_screen_height();
+ if (width) *width = gdk_screen_width();
+ if (height) *height = gdk_screen_height();
}
void wxGetMousePosition( int* x, int* y )
{
- wxFAIL_MSG( "GetMousePosition not yet implemented" );
- if (x) *x = 0;
- if (y) *y = 0;
-};
+ Window dumw;
+ int dumi;
+ unsigned int dumu;
+
+ XQueryPointer( GDK_DISPLAY(),GDK_ROOT_WINDOW(),
+ &dumw,&dumw,x,y,&dumi,&dumi,&dumu );
+}
bool wxColourDisplay(void)
{
- wxFAIL_MSG( "wxColourDisplay always returns TRUE" );
- return TRUE;
+ wxFAIL_MSG( "wxColourDisplay always returns TRUE" );
+ return TRUE;
}
int wxDisplayDepth(void)
{
- wxFAIL_MSG( "wxDisplayDepth always returns 8" );
- return 8;
+ wxFAIL_MSG( "wxDisplayDepth always returns 8" );
+ return 8;
}
//------------------------------------------------------------------------
const char* wxGetHomeDir( wxString *home )
{
- *home = wxGetUserHome( wxString() );
- if (home->IsNull()) *home = "/";
- return *home;
-};
+ *home = wxGetUserHome( wxString() );
+ if (home->IsNull()) *home = "/";
+ return *home;
+}
char *wxGetUserHome( const wxString &user )
{
- struct passwd *who = (struct passwd *) NULL;
+ struct passwd *who = (struct passwd *) NULL;
- if (user.IsNull() || (user== ""))
- {
+ if (user.IsNull() || (user== ""))
+ {
register char *ptr;
if ((ptr = getenv("HOME")) != NULL)
+ {
return ptr;
- if ((ptr = getenv("USER")) != NULL
- || (ptr = getenv("LOGNAME")) != NULL) {
+ }
+ if ((ptr = getenv("USER")) != NULL || (ptr = getenv("LOGNAME")) != NULL)
+ {
who = getpwnam(ptr);
}
// We now make sure the the user exists!
if (who == NULL)
+ {
who = getpwuid(getuid());
- }
- else
- who = getpwnam (user);
+ }
+ }
+ else
+ {
+ who = getpwnam (user);
+ }
- return who ? who->pw_dir : (char*)NULL;
-};
+ return who ? who->pw_dir : (char*)NULL;
+}
//------------------------------------------------------------------------
// id routines
// strncpy(buf, (h=gethostbyname(name))!=NULL ? h->h_name : name, sz-1);
if((unsigned)sz > strlen(name)+strlen(domain)+1)
{
- strcpy(buf, name);
- if(strcmp(domain,"(none)") == 0) // standalone machine
- {
- strcat(buf,".");
- strcat(buf,domain);
- }
+ strcpy(buf, name);
+ if(strcmp(domain,"(none)") == 0) // standalone machine
+ {
+ strcat(buf,".");
+ strcat(buf,domain);
+ }
}
else
- return FALSE;
+ return FALSE;
return TRUE;
#endif
}
bool wxDirExists( const wxString& dir )
{
- char buf[500];
- strcpy( buf, WXSTRINGCAST(dir) );
- struct stat sbuf;
- return ((stat(buf, &sbuf) != -1) && S_ISDIR(sbuf.st_mode) ? TRUE : FALSE);
+ char buf[500];
+ strcpy( buf, WXSTRINGCAST(dir) );
+ struct stat sbuf;
+ return ((stat(buf, &sbuf) != -1) && S_ISDIR(sbuf.st_mode) ? TRUE : FALSE);
};
//------------------------------------------------------------------------
{
GTK_WIDGET_UNSET_FLAGS (myfixed, GTK_NO_WINDOW);
GTK_WIDGET_SET_FLAGS (myfixed, GTK_BASIC);
-
-#if (GTK_MINOR_VERSION == 1)
- gtk_container_set_resize_mode( GTK_CONTAINER(myfixed), GTK_RESIZE_PARENT );
-#endif
myfixed->children = NULL;
}
if (child->widget == widget)
{
- if ((child->x == x) && (child->y == y)) return;
+/* if ((child->x == x) && (child->y == y)) return; */
child->x = x;
child->y = y;
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
+wxBitmap::wxBitmap( const char **bits )
+{
+ wxCHECK_RET( bits != NULL, "invalid bitmap data" )
+
+ m_refData = new wxBitmapRefData();
+
+ GdkBitmap *mask = (GdkBitmap*) NULL;
+ GdkWindow *parent = (GdkWindow*) &gdk_root_parent;
+
+ M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( parent, &mask, NULL, (gchar **) bits );
+
+ if (mask)
+ {
+ M_BMPDATA->m_mask = new wxMask();
+ M_BMPDATA->m_mask->m_bitmap = mask;
+ }
+
+ gdk_window_get_size( M_BMPDATA->m_pixmap, &(M_BMPDATA->m_width), &(M_BMPDATA->m_height) );
+
+ M_BMPDATA->m_bpp = gdk_window_get_visual( parent )->depth; // ?
+ if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
+}
+
wxBitmap::wxBitmap( char **bits )
{
wxCHECK_RET( bits != NULL, "invalid bitmap data" )
return TRUE;
}
+//-----------------------------------------------------------------------------
+// "size_allocate"
+//-----------------------------------------------------------------------------
+
+static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxDialog *win )
+{
+ if (!win->HasVMT()) return;
+
+/*
+ printf( "OnDialogResize from " );
+ if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
+ printf( win->GetClassInfo()->GetClassName() );
+ printf( ".\n" );
+*/
+
+ win->GtkOnSize( alloc->x, alloc->y, alloc->width, alloc->height );
+}
+
//-----------------------------------------------------------------------------
// wxDialog
//-----------------------------------------------------------------------------
EVT_BUTTON (wxID_OK, wxDialog::OnOK)
EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel)
EVT_BUTTON (wxID_APPLY, wxDialog::OnApply)
+ EVT_SIZE (wxDialog::OnSize)
EVT_CLOSE (wxDialog::OnCloseWindow)
END_EVENT_TABLE()
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
GTK_SIGNAL_FUNC(gtk_dialog_delete_callback), (gpointer)this );
+ gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
+ GTK_SIGNAL_FUNC(gtk_dialog_size_callback), (gpointer)this );
+
m_wxwindow = gtk_myfixed_new();
gtk_widget_show( m_wxwindow );
GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
}
}
+void wxDialog::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height )
+{
+ // due to a bug in gtk, x,y are always 0
+ // m_x = x;
+ // m_y = y;
+
+ if ((m_height == height) && (m_width == width) &&
+ (m_sizeSet)) return;
+ if (!m_wxwindow) return;
+
+ m_width = width;
+ m_height = height;
+
+ if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth;
+ if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight;
+ if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_minWidth;
+ if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_minHeight;
+
+ gtk_widget_set_usize( m_widget, m_width, m_height );
+
+ m_sizeSet = TRUE;
+
+ wxSizeEvent event( wxSize(m_width,m_height), GetId() );
+ event.SetEventObject( this );
+ GetEventHandler()->ProcessEvent( event );
+}
+
+void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) )
+{
+ wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+
+ if (GetAutoLayout())
+ {
+ Layout();
+ }
+ else
+ {
+ // no child: go out !
+ if (!GetChildren()->First()) return;
+
+ // do we have exactly one child?
+ wxWindow *child = (wxWindow *) NULL;
+ for(wxNode *node = GetChildren()->First(); node; node = node->Next())
+ {
+ wxWindow *win = (wxWindow *)node->Data();
+ if (!IS_KIND_OF(win,wxFrame) && !IS_KIND_OF(win,wxDialog))
+ {
+ // it's the second one: do nothing
+ if (child) return;
+ child = win;
+ }
+ }
+
+ // yes: set it's size to fill all the frame
+ int client_x, client_y;
+ GetClientSize( &client_x, &client_y );
+ child->SetSize( 1, 1, client_x-2, client_y);
+ }
+}
+
void wxDialog::SetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
- ProcessEvent( event );
+ GetEventHandler()->ProcessEvent( event );
m_resizing = FALSE;
}
static void gtk_frame_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxFrame *win )
{
if (!win->HasVMT()) return;
-
+
/*
printf( "OnFrameResize from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
- win->GtkOnSize( alloc->x, alloc->y, alloc->width, alloc->height );
+
+ if ((win->m_width != alloc->width) || (win->m_height != alloc->height))
+ {
+ win->m_sizeSet = FALSE;
+ win->m_width = alloc->width;
+ win->m_height = alloc->height;
+ }
}
//-----------------------------------------------------------------------------
if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP;
m_widget = gtk_window_new( win_type );
+
if ((size.x != -1) && (size.y != -1))
gtk_widget_set_usize( m_widget, m_width, m_height );
if ((pos.x != -1) && (pos.y != -1))
if (show)
{
+/*
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
m_sizeSet = FALSE;
- ProcessEvent( event );
+ GetEventHandler()->ProcessEvent( event );
+*/
}
return wxWindow::Show( show );
}
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
- ProcessEvent( event );
+ GetEventHandler()->ProcessEvent( event );
m_resizing = FALSE;
}
// m_x = x;
// m_y = y;
- if ((m_height == height) && (m_width == width) &&
- (m_sizeSet)) return;
+ if (m_resizing) return;
+ m_resizing = TRUE;
+
if (!m_wxwindow) return;
m_width = width;
if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_minWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_minHeight;
- gtk_widget_set_usize( m_widget, m_width, m_height );
-
+// gtk_widget_set_usize( m_widget, m_width, m_height );
+
// This emulates the new wxMSW behaviour
if (m_frameMenuBar)
gtk_myfixed_move( GTK_MYFIXED(m_wxwindow), m_frameStatusBar->m_widget, 0, m_height-wxSTATUS_HEIGHT );
gtk_widget_set_usize( m_frameStatusBar->m_widget, m_width, wxSTATUS_HEIGHT );
}
-
+
m_sizeSet = TRUE;
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
- ProcessEvent( event );
+ GetEventHandler()->ProcessEvent( event );
+
+ m_resizing = FALSE;
+}
+
+void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) )
+{
+ if (!m_sizeSet)
+ GtkOnSize( m_x, m_y, m_width, m_height );
+
+ DoMenuUpdates();
}
void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
IMPLEMENT_DYNAMIC_CLASS(wxIcon,wxBitmap)
+wxIcon::wxIcon( const char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
+ wxBitmap( bits )
+{
+}
+
wxIcon::wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
- wxBitmap( bits )
+ wxBitmap( bits )
{
}
{
}
-wxIcon::wxIcon(const wxIcon& icon) : wxBitmap()
+wxIcon::wxIcon( const wxIcon& icon ) : wxBitmap()
{
- Ref(icon);
+ Ref(icon);
}
-wxIcon::wxIcon(const wxIcon* icon) : wxBitmap()
+wxIcon::wxIcon( const wxIcon* icon ) : wxBitmap()
{
- if (icon) Ref(*icon);
+ if (icon) Ref(*icon);
}
-wxIcon& wxIcon::operator = (const wxIcon& icon)
+wxIcon& wxIcon::operator = ( const wxIcon& icon )
{
- if (*this == icon) return (*this);
- Ref(icon);
- return *this;
+ if (*this == icon) return (*this);
+ Ref(icon);
+ return *this;
}
#include <netdb.h>
#include <signal.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xresource.h>
+
+#include "gdk/gdkx.h" // GDK_DISPLAY
#ifdef __SVR4__
#include <sys/systeminfo.h>
void wxBell(void)
{
- gdk_beep();
-};
+ gdk_beep();
+}
void wxSleep(int nSecs)
{
- sleep(nSecs);
-};
+ sleep(nSecs);
+}
int wxKill(long pid, int sig)
{
- return kill(pid, sig);
-};
+ return kill(pid, sig);
+}
void wxDisplaySize( int *width, int *height )
{
- if (width) *width = gdk_screen_width();
- if (height) *height = gdk_screen_height();
+ if (width) *width = gdk_screen_width();
+ if (height) *height = gdk_screen_height();
}
void wxGetMousePosition( int* x, int* y )
{
- wxFAIL_MSG( "GetMousePosition not yet implemented" );
- if (x) *x = 0;
- if (y) *y = 0;
-};
+ Window dumw;
+ int dumi;
+ unsigned int dumu;
+
+ XQueryPointer( GDK_DISPLAY(),GDK_ROOT_WINDOW(),
+ &dumw,&dumw,x,y,&dumi,&dumi,&dumu );
+}
bool wxColourDisplay(void)
{
- wxFAIL_MSG( "wxColourDisplay always returns TRUE" );
- return TRUE;
+ wxFAIL_MSG( "wxColourDisplay always returns TRUE" );
+ return TRUE;
}
int wxDisplayDepth(void)
{
- wxFAIL_MSG( "wxDisplayDepth always returns 8" );
- return 8;
+ wxFAIL_MSG( "wxDisplayDepth always returns 8" );
+ return 8;
}
//------------------------------------------------------------------------
const char* wxGetHomeDir( wxString *home )
{
- *home = wxGetUserHome( wxString() );
- if (home->IsNull()) *home = "/";
- return *home;
-};
+ *home = wxGetUserHome( wxString() );
+ if (home->IsNull()) *home = "/";
+ return *home;
+}
char *wxGetUserHome( const wxString &user )
{
- struct passwd *who = (struct passwd *) NULL;
+ struct passwd *who = (struct passwd *) NULL;
- if (user.IsNull() || (user== ""))
- {
+ if (user.IsNull() || (user== ""))
+ {
register char *ptr;
if ((ptr = getenv("HOME")) != NULL)
+ {
return ptr;
- if ((ptr = getenv("USER")) != NULL
- || (ptr = getenv("LOGNAME")) != NULL) {
+ }
+ if ((ptr = getenv("USER")) != NULL || (ptr = getenv("LOGNAME")) != NULL)
+ {
who = getpwnam(ptr);
}
// We now make sure the the user exists!
if (who == NULL)
+ {
who = getpwuid(getuid());
- }
- else
- who = getpwnam (user);
+ }
+ }
+ else
+ {
+ who = getpwnam (user);
+ }
- return who ? who->pw_dir : (char*)NULL;
-};
+ return who ? who->pw_dir : (char*)NULL;
+}
//------------------------------------------------------------------------
// id routines
// strncpy(buf, (h=gethostbyname(name))!=NULL ? h->h_name : name, sz-1);
if((unsigned)sz > strlen(name)+strlen(domain)+1)
{
- strcpy(buf, name);
- if(strcmp(domain,"(none)") == 0) // standalone machine
- {
- strcat(buf,".");
- strcat(buf,domain);
- }
+ strcpy(buf, name);
+ if(strcmp(domain,"(none)") == 0) // standalone machine
+ {
+ strcat(buf,".");
+ strcat(buf,domain);
+ }
}
else
- return FALSE;
+ return FALSE;
return TRUE;
#endif
}
bool wxDirExists( const wxString& dir )
{
- char buf[500];
- strcpy( buf, WXSTRINGCAST(dir) );
- struct stat sbuf;
- return ((stat(buf, &sbuf) != -1) && S_ISDIR(sbuf.st_mode) ? TRUE : FALSE);
+ char buf[500];
+ strcpy( buf, WXSTRINGCAST(dir) );
+ struct stat sbuf;
+ return ((stat(buf, &sbuf) != -1) && S_ISDIR(sbuf.st_mode) ? TRUE : FALSE);
};
//------------------------------------------------------------------------
{
GTK_WIDGET_UNSET_FLAGS (myfixed, GTK_NO_WINDOW);
GTK_WIDGET_SET_FLAGS (myfixed, GTK_BASIC);
-
-#if (GTK_MINOR_VERSION == 1)
- gtk_container_set_resize_mode( GTK_CONTAINER(myfixed), GTK_RESIZE_PARENT );
-#endif
myfixed->children = NULL;
}
if (child->widget == widget)
{
- if ((child->x == x) && (child->y == y)) return;
+/* if ((child->x == x) && (child->y == y)) return; */
child->x = x;
child->y = y;