1. wxStaticLine implemented (generic (ugly) and MSW versions)
2. wxTextDialog looks fine under MSW again 3. startup tips added: code, sample, docs 4. read-only text controls don't participate in TAB traversal git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart, Markus Holzem, Robert Roebling
|
||||
// Licence: wxWindows license
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -21,15 +21,15 @@
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/button.h"
|
||||
#include "wx/stattext.h"
|
||||
#include "wx/statbmp.h"
|
||||
#include "wx/layout.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/button.h"
|
||||
#include "wx/stattext.h"
|
||||
#include "wx/statbmp.h"
|
||||
#include "wx/layout.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/settings.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -71,9 +71,6 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
|
||||
const wxPoint& pos)
|
||||
: wxDialog( parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE )
|
||||
{
|
||||
static const int LAYOUT_X_MARGIN = 5;
|
||||
static const int LAYOUT_Y_MARGIN = 5;
|
||||
|
||||
m_dialogStyle = style;
|
||||
|
||||
wxBeginBusyCursor();
|
||||
@@ -122,34 +119,12 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
|
||||
|
||||
// split the message in lines
|
||||
// --------------------------
|
||||
wxClientDC dc(this);
|
||||
dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
|
||||
|
||||
wxArrayString lines;
|
||||
wxString curLine;
|
||||
long height, width, heightTextMax = 0, widthTextMax = 0;
|
||||
for ( const char *pc = message; ; pc++ ) {
|
||||
if ( *pc == '\n' || *pc == '\0' ) {
|
||||
dc.GetTextExtent(curLine, &width, &height);
|
||||
if ( width > widthTextMax )
|
||||
widthTextMax = width;
|
||||
if ( height > heightTextMax )
|
||||
heightTextMax = height;
|
||||
|
||||
lines.Add(curLine);
|
||||
|
||||
if ( *pc == '\n' ) {
|
||||
curLine.Empty();
|
||||
}
|
||||
else {
|
||||
// the end of string
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
curLine += *pc;
|
||||
}
|
||||
}
|
||||
wxSize sizeText = SplitTextMessage(message, &lines);
|
||||
long widthTextMax = sizeText.GetWidth(),
|
||||
heightTextMax = sizeText.GetHeight();
|
||||
size_t nLineCount = lines.GetCount();
|
||||
|
||||
// calculate the total dialog size
|
||||
enum
|
||||
@@ -194,7 +169,7 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
|
||||
|
||||
// get the longest caption and also calc the number of buttons
|
||||
size_t nBtn, nButtons = 0;
|
||||
long widthBtnMax = 0;
|
||||
long width, widthBtnMax = 0;
|
||||
for ( nBtn = 0; nBtn < Btn_Max; nBtn++ ) {
|
||||
if ( buttons[nBtn] ) {
|
||||
nButtons++;
|
||||
@@ -215,8 +190,6 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
|
||||
heightTextMax *= 12;
|
||||
heightTextMax /= 10;
|
||||
|
||||
size_t nLineCount = lines.Count();
|
||||
|
||||
long widthButtonsTotal = nButtons * (widthBtnMax + LAYOUT_X_MARGIN) -
|
||||
LAYOUT_X_MARGIN;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user