Exemplo n.º 1
0
bool CWizDatabase::UpdateStyles(const std::deque<WIZSTYLEDATA>& arrayStyle)
{
    if (arrayStyle.empty())
        return true;

    __int64 nVersion = -1;

    bool bHasError = false;
    std::deque<WIZSTYLEDATA>::const_iterator it;
    for (it = arrayStyle.begin(); it != arrayStyle.end(); it++)
    {
        const WIZSTYLEDATA& data = *it;

        Q_EMIT processLog("style: " + data.strName);

        if (!UpdateStyle(data))
        {
            bHasError = true;
        }

        nVersion = std::max<__int64>(nVersion, data.nVersion);
    }

    if (!bHasError)
    {
        SetObjectVersion(WIZSTYLEDATA::ObjectName(), nVersion);
    }

    return !bHasError;
}
Exemplo n.º 2
0
void wxCalendarCtrl::SetWindowStyleFlag(long style)
{
    const long styleOld = GetWindowStyleFlag();

    wxCalendarCtrlBase::SetWindowStyleFlag(style);

    if ( styleOld != GetWindowStyleFlag() )
        UpdateStyle();
}
Exemplo n.º 3
0
static void AddStyle(GtkStyle **ppsComb, GtkStyle *psNew)
{
	if (!*ppsComb)
		*ppsComb = psNew;
	else
	{
		*ppsComb = gtk_style_copy(*ppsComb);
		UpdateStyle(*ppsComb, psNew, psGameList);
	}
}
Exemplo n.º 4
0
bool IWnd_stc::SetFontSize(int fs)
{
	if(fs<6) fs=6;
	if(fs>24) fs=24;
	if(tempp.nsize==fs)
	{
		return false;
	}
	tempp.nsize=fs;
	UpdateStyle();
	return true;
}
Exemplo n.º 5
0
BaseGrid::BaseGrid(wxWindow* parent, agi::Context *context, const wxSize& size, long style, const wxString& name)
: wxWindow(parent, -1, wxDefaultPosition, size, style, name)
, lineHeight(1) // non-zero to avoid div by 0
, holding(false)
, scrollBar(new wxScrollBar(this, GRID_SCROLLBAR, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL))
, byFrame(false)
, extendRow(-1)
, active_line(0)
, batch_level(0)
, batch_active_line_changed(false)
, seek_listener(context->videoController->AddSeekListener(std::bind(&BaseGrid::Refresh, this, false, nullptr)))
, context_menu(0)
, yPos(0)
, context(context)
{
	scrollBar->SetScrollbar(0,10,100,10);

	wxBoxSizer *scrollbarpositioner = new wxBoxSizer(wxHORIZONTAL);
	scrollbarpositioner->AddStretchSpacer();
	scrollbarpositioner->Add(scrollBar, 0, wxEXPAND, 0);

	SetSizerAndFit(scrollbarpositioner);

	SetBackgroundStyle(wxBG_STYLE_PAINT);

	UpdateStyle();
	OnHighlightVisibleChange(*OPT_GET("Subtitle/Grid/Highlight Subtitles in Frame"));

	OPT_SUB("Subtitle/Grid/Font Face", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Subtitle/Grid/Font Size", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Subtitle/Grid/Highlight Subtitles in Frame", &BaseGrid::OnHighlightVisibleChange, this);
	context->ass->AddCommitListener(&BaseGrid::OnSubtitlesCommit, this);
	context->ass->AddFileOpenListener(&BaseGrid::OnSubtitlesOpen, this);
	context->ass->AddFileSaveListener(&BaseGrid::OnSubtitlesSave, this);

	OPT_SUB("Colour/Subtitle Grid/Active Border", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Colour/Subtitle Grid/Background/Background", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Colour/Subtitle Grid/Background/Comment", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Colour/Subtitle Grid/Background/Inframe", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Colour/Subtitle Grid/Background/Selected Comment", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Colour/Subtitle Grid/Background/Selection", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Colour/Subtitle Grid/Collision", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Colour/Subtitle Grid/Header", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Colour/Subtitle Grid/Left Column", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Colour/Subtitle Grid/Lines", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Colour/Subtitle Grid/Selection", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Colour/Subtitle Grid/Standard", &BaseGrid::UpdateStyle, this);
	OPT_SUB("Subtitle/Grid/Hide Overrides", std::bind(&BaseGrid::Refresh, this, false, nullptr));

	Bind(wxEVT_CONTEXT_MENU, &BaseGrid::OnContextMenu, this);
}
Exemplo n.º 6
0
void
JXStyleTableMenu::HandleMenuItem
	(
	const JIndex index
	)
{
	JPoint cell;
	if (itsTable->GetEditedCell(&cell))
		{
		JFontStyle style = itsTable->GetCellStyle(cell);
		UpdateStyle(index, &style);
		itsTable->SetCellStyle(cell, style);
		}
}
Exemplo n.º 7
0
bool wxCalendarCtrl::Create(wxWindow *parent, wxWindowID id, const wxDateTime& date,
    const wxPoint& pos, const wxSize& size, long style, const wxString& name )
{
    m_qtCalendar = new wxQtCalendarWidget( parent, this );
    m_qtCalendar->resize(m_qtCalendar->sizeHint());

    {
        // Init holiday colours
        const QTextCharFormat format = m_qtCalendar->weekdayTextFormat(Qt::Sunday);
        m_colHolidayFg = format.foreground().color();

        wxMISSING_IMPLEMENTATION( "Get holiday background color" );

        // Bug in Qt: returned background color is incorrect
        //m_colHolidayBg = format.background().color();
    }

    {
        // synchronize header colours
        QTextCharFormat format = m_qtCalendar->headerTextFormat();

        bool sync = false;

        if ( m_colHeaderFg.IsOk() )
            sync = true;
        else
            m_colHeaderFg = format.foreground().color();

        if ( m_colHeaderBg.IsOk() )
            sync = true;
        else
            m_colHeaderFg = format.background().color();

        if ( sync )
            SetHeaderColours(m_colHeaderFg, m_colHeaderBg);
    }

    UpdateStyle();

    if ( date.IsValid() )
        SetDate(date);

    return QtCreateControl( parent, id, pos, size, style, wxDefaultValidator, name );
}
Exemplo n.º 8
0
BOOL CModControlBar::Init(UINT nId)
//---------------------------------
{
    HINSTANCE hInstance = AfxGetInstanceHandle();
    TBADDBITMAP tbab;

    SetButtonStructSize(sizeof(TBBUTTON));
    SetBitmapSize(CSize(16, 15));
    SetButtonSize(CSize(27, 24));
    // Add bitmaps
    m_hBarBmp = AfxLoadSysColorBitmap(
                    hInstance,
                    ::FindResource(hInstance, MAKEINTRESOURCE(nId), RT_BITMAP));
    tbab.hInst = NULL;
    tbab.nID = (UINT)m_hBarBmp;
    ::SendMessage(m_hWnd, TB_ADDBITMAP, 16, (LPARAM)&tbab);
    UpdateStyle();
    return TRUE;
}
Exemplo n.º 9
0
void IWnd_stc::UpdateStyle(const String& lang)
{
	wxArrayString s=wxSplit(str2wx(lang),'.');
	if(s.size()==0) return;

	wxString ext=wxT("*.")+s.Last().Lower()+wxT(";");
	for(size_t i=0;i<StcManager::current().langs.size();i++)
	{
		StcLangInfo& lf(StcManager::current().langs[i]);
		if(lf.name==lang||str2wx(lf.filepattern).Find(ext)>=0)
		{
			tempp.nlang=i;
			break;
		}
	}

	if(tempp.nlang!=param.nlang)
	{
		UpdateStyle();
	}
}
Exemplo n.º 10
0
void IWnd_stc::_Init()
{
	param.nlang = -1;

    // Use all the bits in the style byte as styles, not indicators.
    SetStyleBits(8);
    
	wxFont font (ms_param.nsize, wxMODERN, wxNORMAL, wxNORMAL);
    StyleSetFont (wxSTC_STYLE_DEFAULT, font);
    StyleSetForeground(wxSTC_STYLE_DEFAULT, *wxBLACK);
    StyleSetBackground(wxSTC_STYLE_DEFAULT, *wxWHITE);

    StyleSetForeground(wxSTC_STYLE_LINENUMBER,wxColour (wxT("DARK GREY")));
	StyleSetBackground(wxSTC_STYLE_LINENUMBER,*wxWHITE);

    StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY")));

    MarkerDefine(wxSTC_MARKNUM_FOLDER,        wxSTC_MARK_BOXPLUS, wxT("WHITE"), wxT("BLACK"));
    MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN,    wxSTC_MARK_BOXMINUS,  wxT("WHITE"), wxT("BLACK"));
    MarkerDefine(wxSTC_MARKNUM_FOLDERSUB,     wxSTC_MARK_VLINE,     wxT("WHITE"), wxT("BLACK"));
    MarkerDefine(wxSTC_MARKNUM_FOLDEREND,     wxSTC_MARK_BOXPLUSCONNECTED, wxT("WHITE"), wxT("BLACK"));
    MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, wxT("WHITE"), wxT("BLACK"));
    MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER,     wxT("WHITE"), wxT("BLACK"));
    MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL,    wxSTC_MARK_LCORNER,     wxT("WHITE"), wxT("BLACK"));

	UpdateStyle();

    // set visibility
    SetVisiblePolicy (wxSTC_VISIBLE_STRICT|wxSTC_VISIBLE_SLOP, 1);
    SetXCaretPolicy (wxSTC_CARET_EVEN|wxSTC_VISIBLE_STRICT|wxSTC_CARET_SLOP, 1);
    SetYCaretPolicy (wxSTC_CARET_EVEN|wxSTC_VISIBLE_STRICT|wxSTC_CARET_SLOP, 1);

    // annotations
    AnnotationSetVisible(wxSTC_ANNOTATION_BOXED);

    CmdKeyClear (wxSTC_KEY_TAB, 0); // this is done by the menu accelerator key
    SetLayoutCache (wxSTC_CACHE_PAGE);
}
Exemplo n.º 11
0
Gauge *Gauge::SetCriticalLevel(float v)
{
	m_criticalLevel = Clamp(v*m_mult, 0.0f, 1.0f);
	UpdateStyle();
	return this;
}
Exemplo n.º 12
0
void IWnd_stc::UpdateStyle(const StcStyleFlag& flag)
{
	tempp=flag;
	tempp.nlang=param.nlang;
	UpdateStyle();
}
Exemplo n.º 13
0
void SciDoc::setFont(const FXString &font, int size)
{
  sendString(SCI_STYLESETFONT, STYLE_DEFAULT, font.text());
  sendMessage(SCI_STYLESETSIZE, STYLE_DEFAULT, size);
  UpdateStyle();
}
Exemplo n.º 14
0
bool SciDoc::setLanguage(LangStyle*ls)
{
  _lang=ls;
  UpdateStyle();
  return (_lang!=NULL);
}
Exemplo n.º 15
0
// //! [CustomViewerWorkbenchWindowAdvisorPreWindowOpen]
// //! [WorkbenchWindowAdvisorCreateWindowContentsHead]
void CustomViewerWorkbenchWindowAdvisor::CreateWindowContents(berry::Shell::Pointer shell)
{
  //the all containing main window
  QMainWindow* mainWindow = static_cast<QMainWindow*>(shell->GetControl());
// //! [WorkbenchWindowAdvisorCreateWindowContentsHead]
  mainWindow->setVisible(true);

  //the widgets
  QWidget* CentralWidget = new QWidget(mainWindow);
  CentralWidget->setObjectName("CentralWidget");
  CentralWidget->setVisible(true);

  QtPerspectiveSwitcherTabBar* PerspectivesTabBar = new QtPerspectiveSwitcherTabBar(this->GetWindowConfigurer()->GetWindow());
  PerspectivesTabBar->setObjectName("PerspectivesTabBar");
  PerspectivesTabBar->addTab("Image Viewer");
  PerspectivesTabBar->addTab("DICOM-Manager");
  PerspectivesTabBar->setVisible(true);
  PerspectivesTabBar->setDrawBase(false);

  QPushButton* StyleUpdateButton = new QPushButton("Update Style", mainWindow);
  StyleUpdateButton->setMaximumWidth(100);
  StyleUpdateButton->setObjectName("StyleUpdateButton");
  QObject::connect(StyleUpdateButton, SIGNAL( clicked() ), this, SLOT( UpdateStyle() ));

  QToolButton* OpenFileButton = new QToolButton(mainWindow);
  OpenFileButton->setMaximumWidth(100);
  OpenFileButton->setObjectName("FileOpenButton");
  OpenFileButton->setText("Open File");
  QObject::connect(OpenFileButton, SIGNAL( clicked() ), this, SLOT( OpenFile() ));

  QWidget* PageComposite = new QWidget(CentralWidget);
  PageComposite->setObjectName("PageComposite");
  PageComposite->setVisible(true);

  //the layouts
  QVBoxLayout* CentralWidgetLayout = new QVBoxLayout(CentralWidget);
  CentralWidgetLayout->contentsMargins();
  CentralWidgetLayout->setContentsMargins(9,9,9,9);
  CentralWidgetLayout->setSpacing(0);
  CentralWidgetLayout->setObjectName("CentralWidgetLayout");

  QHBoxLayout* PerspectivesLayer = new QHBoxLayout(mainWindow);
  PerspectivesLayer->setObjectName("PerspectivesLayer");

  QHBoxLayout* PageCompositeLayout = new QHBoxLayout(PageComposite);
  PageCompositeLayout->setContentsMargins(0,0,0,0);
  PageCompositeLayout->setSpacing(0);
  PageComposite->setLayout(PageCompositeLayout);
// //! [WorkbenchWindowAdvisorCreateWindowContents]
  //all glued together
  mainWindow->setCentralWidget(CentralWidget);
  CentralWidgetLayout->addLayout(PerspectivesLayer);
  CentralWidgetLayout->addWidget(PageComposite);
  CentralWidget->setLayout(CentralWidgetLayout);
  PerspectivesLayer->addWidget(PerspectivesTabBar);
  PerspectivesLayer->addSpacing(300);
  PerspectivesLayer->addWidget(OpenFileButton);

  //for style customization convenience
  /*PerspectivesLayer->addSpacing(10);
  PerspectivesLayer->addWidget(StyleUpdateButton);*/

  //for correct initial layout, see also bug#1654
  CentralWidgetLayout->activate();
  CentralWidgetLayout->update();

  this->GetWindowConfigurer()->CreatePageComposite(PageComposite);
// //! [WorkbenchWindowAdvisorCreateWindowContents]
}
Exemplo n.º 16
0
LC3bFileWindow::LC3bFileWindow(int Width, int Height, const string &sFN) : FileWindow(Width, Height, sFN, StyleTable, sizeof(StyleTable) / sizeof((StyleTable)[0]))
{
	UpdateStyle(0, pTextEditor->pTextBuffer->length(), pTextEditor->pTextBuffer->length(), 0, NULL);
}
Exemplo n.º 17
0
void Gauge::SetValue(float v)
{
	m_value = Clamp(v*m_mult, 0.0f, 1.0f);
	UpdateStyle();
}
Exemplo n.º 18
0
Gauge *Gauge::SetLevelAscending(bool ascending)
{
	m_levelAscending = ascending;
	UpdateStyle();
	return this;
}
Exemplo n.º 19
0
Gauge *Gauge::SetUpperValue(float v)
{
	m_mult = 1/v;
	UpdateStyle();
	return this;
}
Exemplo n.º 20
0
Gauge *Gauge::SetWarningLevel(float v)
{
	m_warningLevel = Clamp(v*m_mult, 0.0f, 1.0f);
	UpdateStyle();
	return this;
}