Update of /cvsroot/audacity/audacity-src/src/widgets
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv32454/src/widgets
Modified Files:
ExpandingToolBar.cpp
Added Files:
ErrorDialog.cpp ErrorDialog.h
Log Message:
-Checklist fixes
Index: ExpandingToolBar.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/ExpandingToolBar.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- ExpandingToolBar.cpp 21 Jun 2007 13:51:12 -0000 1.7
+++ ExpandingToolBar.cpp 24 Jul 2007 10:45:40 -0000 1.8
@@ -75,6 +75,7 @@
#include "ExpandingToolBar.h"
#include "AButton.h"
#include "../AllThemeResources.h"
+#include "../Experimental.h"
const int kToggleButtonHeight = 8;
const int kTimerInterval = 50; // every 50 ms -> ~20 updates per second
@@ -259,11 +260,13 @@
void ExpandingToolBar::TryAutoCollapse()
{
+#ifdef EXPERIMENTAL_ROLL_UP_DIALOG
if (mIsAutoExpanded == true && mIsManualExpanded == false) {
mToggleButton->PopUp();
mIsAutoExpanded = false;
Fit();
}
+#endif
}
class ExpandingToolBarEvtHandler : public wxEvtHandler
@@ -343,7 +346,11 @@
void ExpandingToolBar::Fit()
{
+#ifdef EXPERIMENTAL_ROLL_UP_DIALOG
mIsExpanded = (mIsAutoExpanded || mIsManualExpanded);
+#else
+ mIsExpanded = true;// JKC - Wedge it open at all times.
+#endif
int width = mButtonSize.x + mGrabberSize.x;
@@ -726,7 +733,12 @@
wxWindowID id,
const wxString& name,
const wxPoint& pos):
- wxDialog(parent, id, name, pos, wxSize(1, 1), wxCAPTION|wxCLOSE_BOX),
+ wxDialog(parent, id, name, pos, wxSize(1, 1),
+// Workaround for bug in __WXMSW__. No close box on a wxDialog unless
wxSYSTEM_MENU is used.
+#ifdef __WXMSW__
+ wxSYSTEM_MENU |
+#endif
+ wxCAPTION|wxCLOSE_BOX),
mChild(NULL)
{
}
--- NEW FILE: ErrorDialog.cpp ---
/**********************************************************************
Audacity: A Digital Audio Editor
ErrorDialog.cpp
Jimmy Johnson
*******************************************************************//**
\class ErrorDialog
Gives an Error message with an option for help.
*//********************************************************************/
#include "../Audacity.h"
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/intl.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/utils.h>
#include "../ShuttleGui.h"
class ErrorDialog : public wxDialog
{
public:
// constructors and destructors
ErrorDialog(wxWindow *parent,
const wxString & dlogTitle,
const wxString & message,
const wxString & helpURL);
private:
wxString dhelpURL;
void OnOk( wxCommandEvent &event );
void OnHelp( wxCommandEvent &event );
DECLARE_EVENT_TABLE()
};
BEGIN_EVENT_TABLE(ErrorDialog, wxDialog)
EVT_BUTTON( wxID_OK, ErrorDialog::OnOk)
EVT_BUTTON( wxID_HELP, ErrorDialog::OnHelp)
END_EVENT_TABLE()
ErrorDialog::ErrorDialog(
wxWindow *parent,
const wxString & dlogTitle,
const wxString & message,
const wxString & helpURL):
wxDialog(parent, (wxWindowID)-1, dlogTitle)
{
dhelpURL = helpURL;
ShuttleGui S(this, eIsCreating);
S.StartVerticalLay();
{
S.SetBorder( 20 );
S.AddFixedText( message );
S.SetBorder( 2 );
S.StartHorizontalLay( );
S.Id( wxID_HELP ).AddButton( _("Help") );
wxButton * pBtn = S.Id( wxID_OK ).AddButton( _("OK"));
pBtn->SetDefault();
pBtn->SetFocus();
S.EndHorizontalLay();
}
S.EndVerticalLay();
Layout();
Fit();
SetMinSize(GetSize());
Center();
#if 0
// Original non ShuttleGui based code.
// Layout did not look good on Windows.
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *vSizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *hSizer = new wxBoxSizer(wxHORIZONTAL);
wxStaticText *statText = new wxStaticText(this, -1, message);
mainSizer->Add(statText, 0, wxALIGN_LEFT|wxALL, 5);
wxButton *help = new wxButton(this, wxID_HELP, _("Help"));
hSizer->Add(help, 0, wxALIGN_LEFT|wxALL, 5);
wxButton *ok = new wxButton(this, wxID_OK, _("OK"));
ok->SetDefault();
ok->SetFocus();
hSizer->Add(ok, 0, wxALIGN_RIGHT|wxALL, 5);
vSizer->Add(hSizer, 0, wxALIGN_CENTER|wxALL, 5);
mainSizer->Add(vSizer, 0, wxALL, 15 );
SetAutoLayout(true);
SetSizer(mainSizer);
mainSizer->Fit(this);
mainSizer->SetSizeHints(this);
#endif
}
void ErrorDialog::OnOk(wxCommandEvent &event)
{
EndModal(true);
}
void ErrorDialog::OnHelp(wxCommandEvent &event)
{
wxLaunchDefaultBrowser(dhelpURL);
EndModal(true);
}
void ShowErrorDialog(wxWindow *parent,
const wxString &dlogTitle,
const wxString &message,
const wxString &helpURL)
{
ErrorDialog dlog(parent, dlogTitle, message, helpURL);
dlog.CentreOnParent();
dlog.ShowModal();
}
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
// version control system. Please do not modify past this point.
//
// Local Variables:
// c-basic-offset: 3
// indent-tabs-mode: nil
// End:
//
// vim: et sts=3 sw=3
// arch-tag: b84d77e0-4375-43f0-868e-3130e18c14c8
--- NEW FILE: ErrorDialog.h ---
/**********************************************************************
Audacity: A Digital Audio Editor
ErrorDialog.h
Jimmy Johnson
**********************************************************************/
#ifndef __AUDACITY_ERRORDIALOG__
#define __AUDACITY_ERRORDIALOG__
#include "../Audacity.h"
#include <wx/defs.h>
#include <wx/window.h>
/// Displays an error dialog with a button that offers help
void ShowErrorDialog(wxWindow *parent,
const wxString &dlogTitle,
const wxString &message,
const wxString &helpURL);
#endif // __AUDACITY_ERRORDIALOG__
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
// version control system. Please do not modify past this point.
//
// Local Variables:
// c-basic-offset: 3
// indent-tabs-mode: nil
// End:
//
// vim: et sts=3 sw=3
// arch-tag: 2b69f33b-2dc8-4b9f-99a1-65d57f554133
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs