diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 0b6a467..83c2e93 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -273,25 +273,23 @@ static void OnCancel( GtkWidget *widget, gpointer data ){ g_dlgSurface.HideDlg(); } -static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ){ - if ( g_surfwin ) { - if ( event->keyval == GDK_Return ) { - if ( g_dlgSurface.m_bEditingTextureWidget ) { - OnApply( NULL, NULL ); - g_dlgSurface.m_bEditingTextureWidget = false; - } - else - { - OnDone( NULL, NULL ); - } - return TRUE; - } - if ( event->keyval == GDK_Escape ) { - OnCancel( NULL, NULL ); - return TRUE; - } - } - return FALSE; +static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ) { + if ( g_surfwin ) { + if ( event->keyval == GDK_Return ) { + if ( g_dlgSurface.m_bEditingTextureWidget ) { + OnApply( NULL, NULL ); + g_dlgSurface.m_bEditingTextureWidget = false; + } else { + OnDone( NULL, NULL ); + } + return TRUE; + } + if ( event->keyval == GDK_Escape ) { + OnCancel( NULL, NULL ); + return TRUE; + } + } + return FALSE; } // the widget can be one of hshift, vshift, hscale, vscale, rotate @@ -499,7 +497,7 @@ void SurfaceDlg::InitDefaultIncrement( texdef_t *tex ){ tex->rotate = 10; } -void SurfaceDlg::BuildDialog(){ +void SurfaceDlg::BuildDialog() { GtkWidget *dlg, *vbox, *hbox2, *frame, *table, *label; GtkWidget *button, *entry, *spin; diff --git a/radiant/surfacedialog.h b/radiant/surfacedialog.h index 159b73f..e4b697d 100644 --- a/radiant/surfacedialog.h +++ b/radiant/surfacedialog.h @@ -28,42 +28,41 @@ //#define DBG_SI 1 #endif -class SurfaceDlg : public Dialog -{ -bool m_bPatchMode; -// brush primitive fake shift scale rot coords -float m_shift[2]; -float m_rotate; -float m_scale[2]; +class SurfaceDlg : public Dialog { + bool m_bPatchMode; + // brush primitive fake shift scale rot coords + float m_shift[2]; + float m_rotate; + float m_scale[2]; public: -SurfaceDlg (); + SurfaceDlg(); -virtual void ShowDlg(); -virtual void HideDlg(); -void SetTexMods(); -void GetTexMods(); + virtual void ShowDlg(); + virtual void HideDlg(); + void SetTexMods(); + void GetTexMods(); -void InitDefaultIncrement( texdef_t * ); + void InitDefaultIncrement( texdef_t * ); -// Dialog Data -int m_nHeight; -int m_nWidth; + // Dialog Data + int m_nHeight; + int m_nWidth; -// 0 is invalid, otherwise it's the Id of the last 'do' we are responsible for -int m_nUndoId; + // 0 is invalid, otherwise it's the Id of the last 'do' we are responsible for + int m_nUndoId; -// is the user editing the texture widget (that changes the behaviour of 'Enter' key from OnDone to OnApply -// reset to false at each SetTexMods or when dealing with Enter key -bool m_bEditingTextureWidget; + // is the user editing the texture widget (that changes the behaviour of 'Enter' key from OnDone to OnApply + // reset to false at each SetTexMods or when dealing with Enter key + bool m_bEditingTextureWidget; protected: -void BuildDialog(); + void BuildDialog(); public: -// called to perform a fitting from the outside (shortcut key) -void FitAll(); -GtkWidget *GetWidget(); // { return m_pWidget; } + // called to perform a fitting from the outside (shortcut key) + void FitAll(); + GtkWidget *GetWidget(); }; #endif // _SURFACEDIALOG_H_