//---------------------------------------------------------
void CINFO_Messages::Add_Line(void)
{
	CSG_Colors	c;

	SetDefaultStyle(wxTextAttr(wxNullColour, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)));

	_Add_Text(wxT("\n\n"));

	c.Set_Ramp(
		Get_Color_asInt(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)),
		Get_Color_asInt(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW))
	);

	c.Set_Count(100);

	for(int i=0; i<c.Get_Count(); i++)
	{
		SetDefaultStyle(wxTextAttr(
			Get_Color_asWX(c.Get_Color(c.Get_Count() - 1 - i)),
			Get_Color_asWX(c.Get_Color(i))
		));

		_Add_Text(wxT("  "));
	}

	SetDefaultStyle(wxTextAttr(wxNullColour, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)));
}
Exemplo n.º 2
0
void CChatSession::AddText(const wxString& text, const wxTextAttr& style, bool newline)
{
	// Split multi-line messages into individual lines
	wxStringTokenizer tokens( text, wxT("\n") );

	while ( tokens.HasMoreTokens() ) {
		// Check if we should add a time-stamp
		if ( GetNumberOfLines() > 1 ) {
			// Check if the last line ended with a newline
			wxString line = GetLineText( GetNumberOfLines() - 1 );
			if ( line.IsEmpty() ) {
				SetDefaultStyle( COLOR_BLACK );

				AppendText( wxT(" [") + wxDateTime::Now().FormatISOTime() + wxT("] ") );
			}
		}

		SetDefaultStyle(style);

		AppendText( tokens.GetNextToken() );

		// Only add newlines after the last line if it is desired
		if ( tokens.HasMoreTokens() || newline ) {
			AppendText( wxT("\n") );
		}
	}
}
Exemplo n.º 3
0
// set this button as the (permanently) default one in its panel
wxWindow *wxButton::SetDefault()
{
    // set this one as the default button both for wxWidgets ...
    wxWindow *winOldDefault = wxButtonBase::SetDefault();

    // ... and Windows
    SetDefaultStyle(wxDynamicCast(winOldDefault, wxButton), false);
    SetDefaultStyle(this, true);

    return winOldDefault;
}
Exemplo n.º 4
0
wxWindow *wxButton::SetDefault()
{
    //
    // Set this one as the default button both for wxWidgets and Windows
    //
    wxWindow* pWinOldDefault = wxButtonBase::SetDefault();

    SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton), false);
    SetDefaultStyle( this, true );

    return pWinOldDefault;
} // end of wxButton::SetDefault
Exemplo n.º 5
0
// set this button as being currently default
void wxButton::SetTmpDefault()
{
    wxTopLevelWindow * const tlw = GetTLWParentIfNotBeingDeleted(this);
    if ( !tlw )
        return;

    wxWindow *winOldDefault = tlw->GetDefaultItem();
    tlw->SetTmpDefaultItem(this);

    SetDefaultStyle(wxDynamicCast(winOldDefault, wxButton), false);
    SetDefaultStyle(this, true);
}
Exemplo n.º 6
0
void wxButton::SetTmpDefault()
{
    wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);

    wxCHECK_RET( tlw, _T("button without top level window?") );

    wxWindow*                       pWinOldDefault = tlw->GetDefaultItem();

    tlw->SetTmpDefaultItem(this);
    SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton), false);
    SetDefaultStyle( this, true );
} // end of wxButton::SetTmpDefault
Exemplo n.º 7
0
// unset this button as currently default, it may still stay permanent default
void wxButton::UnsetTmpDefault()
{
    wxTopLevelWindow * const tlw = GetTLWParentIfNotBeingDeleted(this);
    if ( !tlw )
        return;

    tlw->SetTmpDefaultItem(NULL);

    wxWindow *winOldDefault = tlw->GetDefaultItem();

    // Just as in SetTmpDefault() above, the order is important here.
    SetDefaultStyle(wxDynamicCast(winOldDefault, wxButton), true);
    SetDefaultStyle(this, false);
}
Exemplo n.º 8
0
void wxButton::SetDefault()
{
    wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);

    wxCHECK_RET( tlw, _T("button without top level window?") );

    //
    // Set this one as the default button both for wxWidgets and Windows
    //
    wxWindow*                       pWinOldDefault = tlw->SetDefaultItem(this);

    SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton), false);
    SetDefaultStyle( this, true );
} // end of wxButton::SetDefault
Exemplo n.º 9
0
// set this button as being currently default
void wxButton::SetTmpDefault()
{
    wxTopLevelWindow * const tlw = GetTLWParentIfNotBeingDeleted(this);
    if ( !tlw )
        return;

    wxWindow *winOldDefault = tlw->GetDefaultItem();
    tlw->SetTmpDefaultItem(this);

    // Notice that the order of these statements is important, the old button
    // is not reset if we do it the other way round, probably because of
    // something done by the default DM_SETDEFID handler.
    SetDefaultStyle(this, true);
    SetDefaultStyle(wxDynamicCast(winOldDefault, wxButton), false);
}
Exemplo n.º 10
0
void wxButton::SetTmpDefault()
{
    wxWindow*                       pParent = GetParent();

    wxCHECK_RET( pParent, _T("button without parent?") );

    wxWindow*                       pWinOldDefault = pParent->GetDefaultItem();

    pParent->SetTmpDefaultItem(this);
    SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton)
                    ,FALSE
                   );
    SetDefaultStyle( this
                    ,TRUE
                   );
} // end of wxButton::SetTmpDefault
Exemplo n.º 11
0
Code::Code(wxWindow *parent, wxWindowID id)
	: wxTextCtrl(parent, id, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH, wxDefaultValidator, wxTextCtrlNameStr)
{
	wxTextAttr attr;
	attr.SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
	SetDefaultStyle(attr);
}
Exemplo n.º 12
0
Label::Label(const Unicode::Text& caption)
    :   Widget(),
        mCaption(caption, Font::GetDefaultFont(), 30.f)
{
    SetDefaultStyle("BI_Label");
    LoadStyle(GetDefaultStyle());
}
Exemplo n.º 13
0
void SearchWindow::SearchMessage(const wxString& message)
{
    Freeze();
    SetDefaultStyle(m_messageAttr);
    AppendText(message + "\n");
    Thaw();
}
Exemplo n.º 14
0
void QtStyleManager::RemoveStyles(const QString& repo)
{
  if (repo.isEmpty())
  {
    ClearStyles();
    return;
  }

  for (FileNameToStyleMap::iterator i = styles.begin(); i != styles.end();)
  {
    ExtStyle* style = i.value();
    QFileInfo info(style->fileName);
    if (info.absolutePath() == repo)
    {
      if (style->name == currentStyle->name)
      {
        SetDefaultStyle();
      }

      i = styles.erase(i);
      delete style;
    }
    else
    {
      ++i;
    }
  }
}
Exemplo n.º 15
0
void QtStyleManager::SetStyle(const QString& fileName, bool update)
{
  if (fileName.isEmpty())
  {
    SetDefaultStyle();
    return;
  }

  FileNameToStyleMap::const_iterator i = styles.find(fileName);

  ExtStyle* style = nullptr;
  if (i == styles.end())
  {
    BERRY_WARN << "Style " + fileName.toStdString() << " does not exist";
    style = defaultStyle;
  }
  else
  {
    style = i.value();
  }
  currentStyle = style;

  ReadStyleData(style);

  if (update)
  {
    qApp->setStyleSheet(currentStyle->stylesheet);
    PlatformUI::GetWorkbench()->UpdateTheme();
  }
}
void
AppearanceAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("AppearanceAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("useSystemDefault")) != 0)
        SetUseSystemDefault(node->AsBool());
    if((node = searchNode->GetNode("background")) != 0)
        SetBackground(node->AsString());
    if((node = searchNode->GetNode("foreground")) != 0)
        SetForeground(node->AsString());
    if((node = searchNode->GetNode("fontName")) != 0)
        SetFontName(node->AsString());
    if((node = searchNode->GetNode("style")) != 0)
        SetStyle(node->AsString());
    if((node = searchNode->GetNode("orientation")) != 0)
        SetOrientation(node->AsInt());
    if((node = searchNode->GetNode("defaultForeground")) != 0)
        SetDefaultForeground(node->AsString());
    if((node = searchNode->GetNode("defaultBackground")) != 0)
        SetDefaultBackground(node->AsString());
    if((node = searchNode->GetNode("defaultFontName")) != 0)
        SetDefaultFontName(node->AsString());
    if((node = searchNode->GetNode("defaultStyle")) != 0)
        SetDefaultStyle(node->AsString());
    if((node = searchNode->GetNode("defaultOrientation")) != 0)
        SetDefaultOrientation(node->AsInt());
}
Exemplo n.º 17
0
IPATextCtrl::IPATextCtrl(wxWindow *parent,wxWindowID id,const wxPoint& pos,const wxSize& size) :
	wxTextCtrl(parent,id,_T(""),pos,size,wxTE_MULTILINE)
{
	wxTextAttr attr;
	wxFont font = wxFont(12,wxFONTFAMILY_ROMAN,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_LIGHT);

	attr.SetFont(font);
	SetDefaultStyle(attr);
}
Exemplo n.º 18
0
void wxButton::SetDefault()
{
    wxWindow*                       pParent = GetParent();

    wxCHECK_RET( pParent, _T("button without parent?") );

    //
    // Set this one as the default button both for wxWidgets and Windows
    //
    wxWindow*                       pWinOldDefault = pParent->SetDefaultItem(this);

    SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton)
                    ,FALSE
                   );
    SetDefaultStyle( this
                    ,TRUE
                   );
} // end of wxButton::SetDefault
Exemplo n.º 19
0
void QtStyleManager::RemoveStyle(const QString& styleFileName)
{
  if (currentStyle->fileName == styleFileName)
  {
    SetDefaultStyle();
  }

  delete styles.take(styleFileName);
}
Exemplo n.º 20
0
GridDecorator::GridDecorator()
    :   Icon()
{
    SetDefaultStyle("BI_GridDecorator");
    LoadStyle(GetDefaultStyle());

    for (unsigned int i = Align::TOP_LEFT; i <= Align::BOTTOM_RIGHT; ++i)
        Add(&mIcons[i]);
}
Exemplo n.º 21
0
        TextButton::TextButton(const Unicode::Text& caption)
            :   Widget(),
                ButtonPolicy(*static_cast<Widget*>(this)),
                mCaption(caption),
                mDecorator()
        {
            Add(&mDecorator);
            Add(&mCaption);

            SetDefaultStyle("BI_TextButton");
            LoadStyle(GetDefaultStyle());
        }
Exemplo n.º 22
0
void QtStyleManager::ClearStyles()
{
  for (FileNameToStyleMap::iterator i = styles.begin(); i != styles.end(); )
  {
    if (!i.value()->fileName.startsWith(':'))
    {
      delete i.value();
      i = styles.erase(i);
    }
    else ++i;
  }
  SetDefaultStyle();
}
Exemplo n.º 23
0
void moLogTextCtrl::LogError( moText p_message ) {

    wxString  w = moText2Wx( p_message );

    if (GetNumberOfLines()>10000) {
        Clear();
    }

    SetDefaultStyle( wxTextAttr( wxColour(255,0,0) ) );
    AppendText(w + wxT("\n"));

    ShowPosition( GetLastPosition() );

}
Exemplo n.º 24
0
void moLogTextCtrl::Log( moText p_message ) {

    wxString  w = moText2Wx( p_message );

    ///cada 10000 lineas publicadas, limpia el buffer completo
    if (GetNumberOfLines()>10000) {
        Clear();
    }

    SetDefaultStyle( wxTextAttr( wxColour( 50, 255, 50 )) );
    AppendText(w + wxT("\n"));

    ShowPosition( GetLastPosition() );

}
Exemplo n.º 25
0
        CheckBox::CheckBox(const Unicode::Text& caption)
            :   Widget(),
                mChecked(false),
                mDecorator(),
                mCaption(caption),
                mCheckIcon()
        {
            SetDefaultStyle("BI_CheckBox");
            LoadStyle(GetDefaultStyle());

            Add(&mDecorator);
            Add(&mCaption);
            Add(&mCheckIcon);

            //mCheckIcon.AddMouseListener(this);
            AddMouseListener(this);
        }
Exemplo n.º 26
0
//---------------------------------------------------------------------------
GUI_Main_Text::GUI_Main_Text(Core* _C, wxWindow* parent)
    : wxTextCtrl(parent, -1, __T(""), wxPoint(0, 0), wxSize(parent->GetClientSize().GetWidth()-0, parent->GetClientSize().GetHeight()-0), wxTE_READONLY|wxTE_MULTILINE|wxTE_RICH|wxTE_RICH2),
    GUI_Main_Common_Core(_C)
{
    wxFont Font;
    Font.SetFamily(wxFONTFAMILY_MODERN);
    wxTextAttr Attr;
    Attr.SetFont(Font);
    //Attr.SetFontSize(8);
    SetDefaultStyle(Attr);

    //Drag and Drop
    #if wxUSE_DRAG_AND_DROP && defined(__WXMAC__)
        SetDropTarget(new FileDrop(C));
    #endif //wxUSE_DRAG_AND_DROP

    //Update
    GUI_Refresh();
}
Exemplo n.º 27
0
void THorizontalScrollBar::Construct() {
  
  ProgressIndicatorRail = new TWindow(this);
  ProgressIndicatorRail->draggable = false;
  
  ButtonUp = new TButtonLeft(this);
  ButtonUp->SetName("ButtonLeft");
  ButtonUp->ConnectedObject = this;
  
  ButtonDown = new TButtonRight(this);
  ButtonDown->SetName("ButtonRight");
  ButtonDown->ConnectedObject = this;
  
  ProgressIndicator = new TDraggableButton(ProgressIndicatorRail);
  ProgressIndicator->SetName("ProgressIndicator");
  ProgressIndicator->ConnectedObject = this;
  
  ProgressIndicatorSize = 1;
  ProgressIndicatorPosition = 0.5;
  
  SetDefaultStyle();
}
Exemplo n.º 28
0
PythonIOCtrl::PythonIOCtrl(wxWindow *parent, PythonInterpCtrl *py)
        : wxTextCtrl(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_RICH|wxTE_MULTILINE|wxTE_READONLY|wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB|wxEXPAND)
{
    m_pyctrl = py;
    m_line_entry_mode=false;
    // setting the default editor font size to 10 point
    wxFont font(10, wxMODERN, wxNORMAL, wxNORMAL);

    ConfigManager* mgr = Manager::Get()->GetConfigManager(_T("editor"));
    wxString fontstring = mgr->Read(_T("/font"), wxEmptyString);

    if (!fontstring.IsEmpty())
    {
        wxNativeFontInfo nfi;
        nfi.FromString(fontstring);
        font.SetNativeFontInfo(nfi);
    }

    wxTextAttr ta;
    ta.SetFont(font);
    SetDefaultStyle(ta);
}
Exemplo n.º 29
0
void QtStyleManager::ReadPreferences()
{
  IPreferencesService* prefService = WorkbenchPlugin::GetDefault()->GetPreferencesService();
  IPreferences::Pointer stylePref = prefService->GetSystemPreferences()->Node(QtPreferences::QT_STYLES_NODE);

  QString paths = stylePref->Get(QtPreferences::QT_STYLE_SEARCHPATHS, "");
  QStringList pathList = paths.split(";", QString::SkipEmptyParts);
  QStringListIterator it(pathList);
  while (it.hasNext())
  {
    AddStyles(it.next());
  }

  QString styleName = stylePref->Get(QtPreferences::QT_STYLE_NAME, "");
  // if a style is contributed via the Qt resource mechanism, it may not be
  // registered yet.
  if (Contains(styleName))
    // do not update the style in the QApplication instance,
    // since it might not be created yet
    SetStyle(styleName, false);
  else
    SetDefaultStyle(false);
}
Exemplo n.º 30
0
//---------------------------------------------------------
void CINFO_Messages::_Set_Style(TSG_UI_MSG_STYLE Style)
{
	int			i	= 0;
	wxColour	c	= wxColour(0, 0, 0);
	wxFont		f	= wxSystemSettings::GetFont(wxSYS_ANSI_VAR_FONT);//wxSYS_SYSTEM_FONT);
	wxTextAttr	t;

	f.SetPointSize((int)(0.5 + 0.9 * f.GetPointSize()));	// generally scale message window font to 90 percent


	switch( Style )
	{
	default:
	case SG_UI_MSG_STYLE_NORMAL:
		break;

	case SG_UI_MSG_STYLE_BOLD:
		f.SetWeight(wxFONTWEIGHT_BOLD);
		break;

	case SG_UI_MSG_STYLE_ITALIC:
		f.SetStyle(wxFONTSTYLE_ITALIC);
		break;

	case SG_UI_MSG_STYLE_SUCCESS:
		c	= wxColour(  0, 127,   0);
		break;

	case SG_UI_MSG_STYLE_FAILURE:
		c	= wxColour(127,   0,   0);
		break;

	case SG_UI_MSG_STYLE_BIG:
		f.SetWeight(wxFONTWEIGHT_BOLD);
		f.SetPointSize((int)(0.5 + 1.1 * f.GetPointSize()));
		break;

	case SG_UI_MSG_STYLE_SMALL:
		f.SetWeight(wxFONTWEIGHT_LIGHT);
		f.SetPointSize((int)(0.5 + 0.9 * f.GetPointSize()));
		break;

	case SG_UI_MSG_STYLE_01:
		i	= 50;
		c	= wxColour(  0,   0, 127);
		f.SetWeight(wxFONTWEIGHT_LIGHT);
		break;

	case SG_UI_MSG_STYLE_02:
		break;

	case SG_UI_MSG_STYLE_03:
		c	= wxColour(  0,   0, 127);
		f.SetWeight(wxFONTWEIGHT_BOLD);
		break;
	}


	t.SetLeftIndent(i);
	t.SetTextColour(c);
	t.SetFont(f);

	SetDefaultStyle(t);
}