示例#1
0
void sToolBorder::OnLayoutChilds()
{
    if(Top)
        Inner.y0 += ReqSizeY;
    else
        Inner.y1 -= ReqSizeY;

    int pos = Client.x0;
    int y0 = Client.y0;
    int y1 = Client.y1;
    if(Top)
        y1 = y0+ReqSizeY-Style()->ToolBorderSize;
    else
        y0 = y1-ReqSizeY+Style()->ToolBorderSize;

    bool first = true;
    bool spaced = false;
    for(auto w : Childs)
    {
        if(!first && (w->Flags & sWF_GiveSpace) && !spaced)
            pos += Style()->Font->CellHeight;
        first = false;
        spaced = (w->Flags & sWF_GiveSpace)!=0;
        w->Outer.x0 = pos;
        pos += w->DecoratedSizeX;
        w->Outer.x1 = pos;
        w->Outer.y0 = y0;
        w->Outer.y1 = y1;
    }
}
示例#2
0
文件: pprompt.cpp 项目: garyqinyu/abv
/*--------------------------------------------------------------------------*/
SIGNED PegPrompt::Message(const PegMessage &Mesg)
{
    switch(Mesg.wType)
    {
    case PM_CURRENT:
        PegThing::Message(Mesg);
        if (!(Style() & AF_TRANSPARENT))
        {
            Invalidate(mClip);
            Draw();
        }
        break;

    case PM_NONCURRENT:
        PegThing::Message(Mesg);
        if (!(Style() & AF_TRANSPARENT))
        {
            Invalidate(mClip);
            Draw();
        }
        break;

    default:
        PegThing::Message(Mesg);
        break;
    }
    return 0;
}
示例#3
0
	virtual void generateStyles()
	{
		Style wayStyle = Style();
		wayStyle.color = Color(0.9f, 0.9f, 0.9f, 1.0f);
		wayStyle.casing_color = Color(0.0f, 0.0f, 0.0f, 1.0f);
		wayStyle.width = 10.0;
		wayStyle.casing_width = 1.0;

		wayStyle.text = "Keine Panik.";
		wayStyle.font_size = 8.0;
		wayStyle.text_color = Color(0.0f, 0.0f, 0.0f, 1.0f);
		wayStyle.text_halo_color = Color(1.0f, 0.0f, 0.0f, 0.3f);
		wayStyle.text_halo_radius = 1.0;
		wayStyle.text_position = Style::TextPosition::POSITION_LINE;
		styles[CachedString("line_se")] = wayStyle;
		styles[CachedString("line_ne")] = wayStyle;
		styles[CachedString("line_sw")] = wayStyle;
		styles[CachedString("line_nw")] = wayStyle;
		styles[CachedString("line_up")] = wayStyle;
		styles[CachedString("line_down")] = wayStyle;
		styles[CachedString("line_left")] = wayStyle;
		styles[CachedString("line_right")] = wayStyle;
		styles[CachedString("arc_1")] = wayStyle;
		styles[CachedString("arc_2")] = wayStyle;
		styles[CachedString("arc_3")] = wayStyle;

		wayStyle.text_position = Style::TextPosition::POSITION_CENTER;
		styles[CachedString("rect_1")] = wayStyle;

		Style nodeStyle = Style();
		Style nodeStyleDefault = Style();
		nodeStyleDefault.color = Color(1.0f, 0.0f, 0.0f, 1.0f);
		nodeStyleDefault.width = 2.0;
		nodeStyleDefault.text_color = Color(0.0f, 0.0f, 0.0f, 1.0f);
		nodeStyleDefault.text_position = Style::TextPosition::POSITION_CENTER;
		nodeStyleDefault.text = "Keine Panik.";
		nodeStyleDefault.font_size = 12.0;

		styles[CachedString("point_00")] = nodeStyleDefault;
		// too small
		nodeStyle = nodeStyleDefault;
		nodeStyle.font_size = 0.0;
		styles[CachedString("point_01")] = nodeStyle;
		// no text
		nodeStyle = nodeStyleDefault;
		nodeStyle.text = "";
		styles[CachedString("point_02")] = nodeStyle;
		// transparent color
		nodeStyle = nodeStyleDefault;
		nodeStyle.text_color = Color(0.0f, 0.0f, 0.0f, 0.0f);
		styles[CachedString("point_10")] = nodeStyle;

		nodeStyleDefault.text_halo_color = Color(0.0f, 1.0f, 1.0f, 1.0f);
		nodeStyleDefault.text_halo_radius = 2.0;
		styles[CachedString("point_11")] = nodeStyleDefault;
		// no halo radius
		nodeStyle = nodeStyleDefault;
		nodeStyleDefault.text_halo_radius = 0.0;
		styles[CachedString("point_12")] = nodeStyleDefault;
	}
示例#4
0
void view_module(TString runNumber, Int_t iBar, Int_t iSide)
{
    TString inDir = "/Volumes/Data/kresan/s438b/data/";
    
    const Int_t fNofPMTs = 800;
    
    TString fileName = inDir + runNumber + "_raw_land.root";
    TFile *file = new TFile(fileName);
    char str[100];
    Int_t index = (Double_t)fNofPMTs / 2. * (iSide - 1) + iBar - 1;
    sprintf(str, "hTime_%d", index);
    TH1F *h1 = (TH1F*) file->Get(str);
    
    TPstyle();
    Style(h1, "TAC channel", "Time (ns)");
    h1->GetYaxis()->SetNdivisions(510);
    TCanvas *c1 = new TCanvas("c1", "", 10, 10, 500, 500);
    gPad->SetLeftMargin(0.15);
    gPad->SetRightMargin(0.05);
    h1->Draw();
    sprintf(str, "Bar: %3d, Side: %d", iBar, iSide);
    TPaveText *t1 = new TPaveText(0.192, 0.780, 0.623, 0.875, "NDC");
    t1->AddText(str);
    Style(t1);
    t1->Draw();
}
示例#5
0
    TextWidget::TextWidget(
        SUnit height, SVec p, Widget* parent, 
        const std::string& t,
        const SORE_Graphics::Color& c)
        : Widget(SVec(SUnit(), height), p, parent), color(c)
    {
        face = fontCache.Get(Style()["TextWidget"]["font"].asString());
        material = materialCache.Clone(Style()["TextWidget"]["material"].asString());

        SetText(t);
    }
示例#6
0
void sToolBorder::OnPaint(int layer)
{
    if(Top)
    {
        sRect r(Outer);
        r.y1 = r.y0 + ReqSizeY;
        Style()->Rect(layer,this,sSK_ToolBorder_Top,r);
    }
    else
    {
        sRect r(Outer);
        r.y0 = r.y1 - ReqSizeY;
        Style()->Rect(layer,this,sSK_ToolBorder_Bottom,r);
    }
}
/*!
  \internal
  Opens directory as a style.
*/
void MainWindow::openStyle()
{
    const QString path = QFileDialog::getExistingDirectory(this);
    if (path.isEmpty())
        return;
    addStyle(Style(path));
}
logical TButtonGroup :: DoCreate ( )
{
  OSButtonGroup      *obuttongroup = Style();
  logical             term = NO;
BEGINSEQ
  if ( TField::DoCreate() )                          ERROR

  if ( !complexWidget )
    if ( !(complexWidget = ComplexWidgetParent()->CreateSubWindow(elementStyle->get_sys_ident())) )
                                                     OADIERR(95)
  
  if ( complexWidget->CreateClientArea(elementStyle->GetControlName(),
                                       NO,
                                       elementStyle->get_displayLevel(),
                                       YES, 
                                       WT_ButtonGroup,obuttongroup->get_vertical(),
                                       obuttongroup->get_exclusive()) )
                                                     ERROR
  complexWidget->SetExtraData(this);
  
  if ( elementStyle->get_docking_area() )
    complexWidget->CreateDockingArea();

RECOVER
  term = YES;
ENDSEQ
  return(term);
}
示例#9
0
void sTabBorderBase::UpdateElements()
{
    if(Screen==0)
        return;
    auto sty = Style();
    int x = Client.x0;
    ClearDragDrop();
    int n = 0;
    for(sTabDummyElement *e : *Array)
    {
        sTabElementInfo &info = e->*Info;
        int w = sty->Font->GetWidth(info.Name) + sty->Font->Advance*2;
        info.Client.x0 = x+4;
        info.Client.y0 = Client.y0;
        x += w;
        info.Client.x1 = x-4;
        info.Client.y1 = Client.y1;

        info.HoverDelete = false;

        sDragDropIcon dd(info.Client,1,n++,info.Name);
        AddDragDrop(dd);
    }

    BoxesDirty = false;
}
示例#10
0
logical TWindow :: DoCreate ( )
{
  logical             term = NO;
BEGINSEQ
// 1,65 (44)
  if ( TField::DoCreate() )                          ERROR

statistics5.Start();
  if ( !complexWidget )
    if ( !(complexWidget = ComplexWidgetParent()->CreateSubWindow(elementStyle->get_sys_ident())) )
                                                     OADIERR(95)
  
  if ( complexWidget->CreateClientArea(elementStyle->GetControlName(),
                                       Style()->IsWorkspace(),
                                       elementStyle->get_displayLevel(),
                                       elementStyle->IsField() && frameStyle->IsSimpleWindow(),
                                       WT_Normal,NO,NO) )
                                                     ERROR
  complexWidget->SetExtraData(this);
  
  if ( elementStyle->get_docking_area() )
    complexWidget->CreateDockingArea();
  

RECOVER
  term = YES;
ENDSEQ
statistics5.Stop();
  return(term);
}
示例#11
0
wxPanel * ShuttleGuiBase::StartPanel(int iStyle)
{
   UseUpId();
   if( mShuttleMode != eIsCreating )
      return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxPanel);
   wxPanel * pPanel;
   mpWind = pPanel = new wxPanel( mpParent, miId, wxDefaultPosition, wxDefaultSize,
      Style( wxNO_BORDER ));

   mpWind->SetBackgroundColour( 
      iStyle==0 
      ? wxColour( 190,200,230) :
      wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW) 
      );
   miProp=0;
   miBorder=2;
   UpdateSizers();  // adds window in to current sizer.

   // create a sizer within the window...
   mpParent = pPanel;
   mpSizer = new wxBoxSizer( wxVERTICAL );
   pPanel->SetSizer( mpSizer );
   PushSizer();
   return pPanel;
}
示例#12
0
 DBInt IsChanged() {
     if (Foreground() != ForegroundFLD->Int(OrigREC)) return (true);
     if (Background() != BackgroundFLD->Int(OrigREC)) return (true);
     if (Style() != StyleFLD->Int(OrigREC)) return (true);
     if (strcmp(Name(), OrigREC->Name()) != 0) return (true);
     return (false);
 }
示例#13
0
wxTextCtrl * ShuttleGuiBase::AddTextBox(const wxString &Caption, const wxString &Value, const int nChars)
{
   UseUpId();
   if( mShuttleMode != eIsCreating )
      return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl);
   wxTextCtrl * pTextCtrl;
   wxSize Size(wxDefaultSize);
   if( nChars > 0 )
   {
      Size.SetWidth( nChars *5 );
   }
   AddPrompt( Caption );
   miProp=0;

#ifdef RIGHT_ALIGNED_TEXTBOXES
   long flags = wxTE_RIGHT;
#else
   long flags = wxTE_LEFT;
#endif

   mpWind = pTextCtrl = new wxTextCtrl(mpParent, miId, Value,
      wxDefaultPosition, Size, Style( flags ));
   UpdateSizers();
   return pTextCtrl;
}
/*! \brief    Build the control preview.
 *
 * \param parent wxWindow*    The parent window.
 * \param flags long                    The control flags.
 * \return wxObject*                     The constructed control.
 *
 */
wxObject* wxsFontPickerCtrl::OnBuildPreview(wxWindow* Parent,long Flags)
{
    wxFontPickerCtrl* Preview;
    wxFont fnt = m_fdFont.BuildFont();
    Preview = new wxFontPickerCtrl(Parent, GetId(), fnt, Pos(Parent), Size(Parent), Style());
    return SetupWindow(Preview,Flags);
}
示例#15
0
VOID Calendar::rebuild(BOOL reset_title)
{
	CTextStyle Style(database);

/* Extract the current styles. */

//	get_frame_style(&m_LabelFontStyle, SKELETON_PANEL, LABEL_FRAME_PANEL);
//	get_frame_style(&m_NumberFontStyle, DATE_PANEL, DATE_PANEL);

/* Delete what we rebuild. */

	Style.SetDefault();

	delete_skeleton_group(reset_title, &Style);
	delete_group(DATE_PANEL);

/* Do the construction. */

	calc_and_build(&Style);

/* Relayout the enhanced dates. */

	rebuild_dates(find_group(TEXT_PANEL));
	rebuild_dates(find_group(GRAPHIC_PANEL));
}
wxObject* wxsHtmlWindow::OnBuildPreview(wxWindow* Parent,long Flags)
{
    wxHtmlWindow* Preview = new wxHtmlWindow(Parent,GetId(),Pos(Parent),Size(Parent),Style());
    if ( Borders.Value )
    {
        Preview->SetBorders(Borders.GetPixels(Parent));
    }
    if ( !Url.empty() )
    {
        if ( Flags & pfExact )
        {
            Preview->LoadPage(Url);
        }
        else
        {
            Preview->SetPage(
                wxString(_T("<body><center>")) +
                _("Following url will be used:") +
                _T("<br>") + Url + _T("</center></body>"));
        }
    }
    else if ( !HtmlCode.empty() )
    {
        Preview->SetPage(HtmlCode);
    }

    return SetupWindow(Preview,Flags);
}
示例#17
0
	virtual void generateStyles()
	{
		Style wayStyle = Style();
		wayStyle.color = Color(0.8f, 0.0f, 0.0f, 1.0f);
		wayStyle.casing_color = Color(0.0f, 0.8f, 0.0f, 1.0f);
		wayStyle.width = 8.0;
		wayStyle.casing_width = 4.0;

		// no dashes
		styles[CachedString("line_1")] = wayStyle;

		// stroke dashes
		wayStyle.dashes = {2, 4};
		styles[CachedString("line_2")] = wayStyle;

		// casing dashes and stroke dashes
		wayStyle.casing_dashes = {2, 4};
		styles[CachedString("line_3")] = wayStyle;

		// only casing dashes
		wayStyle.dashes = std::vector<double>();
		wayStyle.casing_dashes = {2, 4};
		styles[CachedString("line_4")] = wayStyle;

		wayStyle.dashes = {1, 2, 3, 4};
		wayStyle.casing_dashes = std::vector<double>();
		styles[CachedString("crossing_1")] = wayStyle;
		wayStyle.dashes = {4};
		styles[CachedString("crossing_2")] = wayStyle;

	}
示例#18
0
wxObject* wxsPanel::OnBuildPreview(wxWindow* Parent,long Flags)
{
    wxWindow* NewItem = 0;
    if ( Flags & pfExact )
    {
        NewItem = new wxPanel(Parent,GetId(),Pos(Parent),Size(Parent),Style());
    }
    else
    {
        NewItem = new PanelPreview(Parent,GetId(),Pos(Parent),Size(Parent),Style(),IsRootItem());
    }
    NewItem->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
    SetupWindow(NewItem,Flags);
    AddChildrenPreview(NewItem,Flags);
    return NewItem;
}
示例#19
0
	virtual void generateStyles()
	{
		Style wayStyle = Style();
		wayStyle.color = Color(1.0f, 0.0f, 0.0f, 1.0f);
		wayStyle.casing_color = Color(0.0f, 1.0f, 0.0f, 1.0f);

		// stroke and casing
		wayStyle.width = 5.0;
		wayStyle.casing_width = 3.0;
		styles[CachedString("line_1")] = wayStyle;

		// only casing
		wayStyle.width = 0.0;
		wayStyle.casing_width = 3.0;
		styles[CachedString("line_2")] = wayStyle;

		// only stroke
		wayStyle.width = 1.0;
		wayStyle.casing_width = 0.0;
		styles[CachedString("line_3")] = wayStyle;

		// no stroke, no casing
		wayStyle.width = 0.0;
		wayStyle.casing_width = 0.0;
		styles[CachedString("line_4")] = wayStyle;
	}
示例#20
0
	virtual void generateStyles()
	{
		Style wayStyle = Style();
		wayStyle.color = Color(0.8f, 0.0f, 0.0f, 1.0f);
		wayStyle.casing_color = Color(0.0f, 0.8f, 0.0f, 1.0f);
		wayStyle.width = 10.0;
		wayStyle.casing_width = 5.0;

		// round casing + none stroke
		wayStyle.linecap = Style::LineCap::CAP_NONE;
		wayStyle.casing_linecap = Style::LineCap::CAP_ROUND;
		styles[CachedString("line_1")] = wayStyle;

		// square casing + round stroke
		wayStyle.linecap = Style::LineCap::CAP_ROUND;
		wayStyle.casing_linecap = Style::LineCap::CAP_SQUARE;
		styles[CachedString("line_2")] = wayStyle;

		// none casing + square stroke
		wayStyle.linecap = Style::LineCap::CAP_SQUARE;
		wayStyle.casing_linecap = Style::LineCap::CAP_NONE;
		styles[CachedString("line_3")] = wayStyle;

		// square casing + square stroke
		wayStyle.linecap = Style::LineCap::CAP_SQUARE;
		wayStyle.casing_linecap = Style::LineCap::CAP_SQUARE;
		styles[CachedString("line_4")] = wayStyle;

		wayStyle.linecap = Style::LineCap::CAP_ROUND;
		wayStyle.casing_linecap = Style::LineCap::CAP_SQUARE;
		styles[CachedString("crossing_1")] = wayStyle;
		wayStyle.color = Color(0.0f, 0.0f, 0.8f, 1.0f);
		styles[CachedString("crossing_2")] = wayStyle;
	}
示例#21
0
wxComboBox * ShuttleGuiBase::AddCombo( const wxString &Prompt, const wxString &Selected,const wxArrayString * pChoices )
{
   UseUpId();
   if( mShuttleMode != eIsCreating )
      return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxComboBox);
   wxComboBox * pCombo;
   miProp=0;

   int n = pChoices->GetCount();
   if( n>50 ) n=50;
   int i;
   wxString Choices[50];
   for(i=0;i<n;i++)
   {
      Choices[i] = (*pChoices)[i];
   }

   AddPrompt( Prompt );

   mpWind = pCombo = new wxComboBox(mpParent, miId, Selected, wxDefaultPosition, wxDefaultSize, 
      n, Choices, Style( 0 ));

   UpdateSizers();
   return pCombo;
}
示例#22
0
文件: UISymbols.C 项目: bandi13/RGIS
		void Update ()
			{
			ForegroundFLD->Int (OrigREC,Foreground ());
			BackgroundFLD->Int (OrigREC,Background ());
			StyleFLD->Int (OrigREC,Style ());
			OrigREC->Name (Name ());
			}
wxObject* wxsListbook::OnBuildPreview(wxWindow* Parent,long PreviewFlags)
{
    UpdateCurrentSelection();
    wxListbook* Listbook = new wxListbook(Parent,-1,Pos(Parent),Size(Parent),Style());

    if ( !GetChildCount() && !(PreviewFlags&pfExact) )
    {
        // Adding additional empty notebook to prevent from having zero-sized notebook
        Listbook->AddPage(
            new wxPanel(Listbook,-1,wxDefaultPosition,wxSize(50,50)),
            _("No pages"));
    }

    AddChildrenPreview(Listbook,PreviewFlags);

    for ( int i=0; i<GetChildCount(); i++ )
    {
        wxsItem* Child = GetChild(i);
        wxsListbookExtra* LBExtra = (wxsListbookExtra*)GetChildExtra(i);

        wxWindow* ChildPreview = wxDynamicCast(GetChild(i)->GetLastPreview(),wxWindow);
        if ( !ChildPreview ) continue;

        bool Selected = (Child == m_CurrentSelection);
        if ( PreviewFlags & pfExact ) Selected = LBExtra->m_Selected;

        Listbook->AddPage(ChildPreview,LBExtra->m_Label,Selected);
    }

    return Listbook;
}
示例#24
0
文件: pbutton.cpp 项目: garyqinyu/abv
/*--------------------------------------------------------------------------*/
void PegButton::EraseFocusIndicator(void)
{
    if (!StatusIs(PSF_VISIBLE))
    {
        return;
    }
    PegColor RectColor;

    if (Type() == TYPE_RADIOBUTTON || Type() == TYPE_CHECKBOX)
    {
        RectColor.Set(Parent()->muColors[PCI_NORMAL], BLACK, CF_NONE);
    }
    else
    {
        RectColor.Set(muColors[PCI_NORMAL], BLACK, CF_NONE);
    }

    if (Style() & AF_TRANSPARENT)
    {
        Invalidate();
        Parent()->Draw();
    }
    else
    {
        PegRect FocusRect = mClient;
        FocusRect--;
        Invalidate(FocusRect);
        BeginDraw();
        Rectangle(FocusRect, RectColor, 1);
        EndDraw();
    }
}
示例#25
0
文件: fake.C 项目: kskovpen/bTag
void SetStyle()
{
  static TStyle* style = 0;
//  std::cout << "\nApplying ATLAS style settings...\n" << std::endl ;
  if( style==0 ) style = Style();
  gROOT->SetStyle("STYLE");
  gROOT->ForceStyle();
}
示例#26
0
wxObject* wxsGauge::OnBuildPreview(wxWindow* Parent,long Flags)
{
    wxGauge* Preview = new wxGauge(Parent,GetId(),Range,Pos(Parent),Size(Parent),Style());
    if ( Value )  Preview->SetValue(Value);
    if ( Shadow ) Preview->SetShadowWidth(Shadow);
    if ( Bezel )  Preview->SetBezelFace(Bezel);
    return SetupWindow(Preview,Flags);
}
示例#27
0
void sToolBorder::OnCalcSize()
{
    ReqSizeX = 0;
    ReqSizeY = 0;
    for(auto w : Childs)
        ReqSizeY = sMax(ReqSizeY,w->DecoratedSizeY);
    ReqSizeY += Style()->ToolBorderSize;
}
示例#28
0
void
BSlider::DrawThumb()
{
	if (Style() == B_BLOCK_THUMB)
		_DrawBlockThumb();
	else
		_DrawTriangleThumb();
}
示例#29
0
void sScrollBorder::OnCalcSize()
{
    int w = Style()->ScrollBorderSize;
    if(EnableX)
        ReqSizeY = w;
    if(EnableY)
        ReqSizeX = w;
}
示例#30
0
	virtual void generateStyles()
	{
		Style wayStyle = Style();
		wayStyle.fill_color = Color(1.0f, 0.0f, 0.0f, 0.5f);
		wayStyle.color = Color(0.0f, 0.0f, 0.0f, 1.0f);
		wayStyle.width = 1.0;

		Style relStyle = Style();
		relStyle.fill_color = Color(1.0f, 0.0f, 0.0f, 0.5f);
		relStyle.color = Color(0.0f, 0.0f, 0.0f, 1.0f);
		relStyle.width = 1.0;

		styles[CachedString("way_1")] = wayStyle;
		styles[CachedString("rel_1")] = relStyle;

		relStyle.fill_color = Color(0.0f, 1.0f, 0.0f, 0.5f);
		styles[CachedString("rel_2")] = relStyle;
	}