コード例 #1
0
void StripMenuButton::doPaint(wxDC* dc)
{
	wxFont font = GetFont();

	if (m_bBold)
		font.SetWeight(wxFONTWEIGHT_BOLD);

	dc->SetFont(font);
	dc->SetTextBackground(GetBackgroundColour());
	dc->SetTextForeground(GetForegroundColour());

	if (!m_imgBg.getImg() || !m_imgBg->IsOk())
	{
		wxBrush bg = dc->GetBackground();
		dc->SetBackground(wxBrush(this->GetBackgroundColour()));
		dc->Clear();
		dc->SetBackground(bg);
	}
	else
	{
		paintBGImage(dc);
	}

	paintLabel(dc);
}
コード例 #2
0
ファイル: wlabel.c プロジェクト: awmaker/awmaker
void WMSetLabelImagePosition(WMLabel * lPtr, WMImagePosition position)
{
	lPtr->flags.imagePosition = position;
	if (lPtr->view->flags.realized) {
		paintLabel(lPtr);
	}
}
コード例 #3
0
ファイル: wlabel.c プロジェクト: awmaker/awmaker
void WMSetLabelTextAlignment(WMLabel * lPtr, WMAlignment alignment)
{
	lPtr->flags.alignment = alignment;
	if (lPtr->view->flags.realized) {
		paintLabel(lPtr);
	}
}
コード例 #4
0
ファイル: wlabel.c プロジェクト: awmaker/awmaker
void WMSetLabelRelief(WMLabel * lPtr, WMReliefType relief)
{
	lPtr->flags.relief = relief;
	if (lPtr->view->flags.realized) {
		paintLabel(lPtr);
	}
}
コード例 #5
0
ファイル: wlabel.c プロジェクト: awmaker/awmaker
void WMSetLabelWraps(WMLabel * lPtr, Bool flag)
{
	flag = ((flag == 0) ? 0 : 1);
	if (lPtr->flags.noWrap != !flag) {
		lPtr->flags.noWrap = !flag;
		if (lPtr->view->flags.realized)
			paintLabel(lPtr);
	}
}
コード例 #6
0
ファイル: wlabel.c プロジェクト: awmaker/awmaker
void WMSetLabelTextColor(WMLabel * lPtr, WMColor * color)
{
	if (lPtr->textColor)
		WMReleaseColor(lPtr->textColor);
	lPtr->textColor = WMRetainColor(color);

	if (lPtr->view->flags.realized) {
		paintLabel(lPtr);
	}
}
コード例 #7
0
ファイル: wlabel.c プロジェクト: awmaker/awmaker
void WMSetLabelFont(WMLabel * lPtr, WMFont * font)
{
	if (lPtr->font != NULL)
		WMReleaseFont(lPtr->font);
	if (font)
		lPtr->font = WMRetainFont(font);
	else
		lPtr->font = NULL;

	if (lPtr->view->flags.realized) {
		paintLabel(lPtr);
	}
}
コード例 #8
0
ファイル: wlabel.c プロジェクト: awmaker/awmaker
void WMSetLabelImage(WMLabel * lPtr, WMPixmap * image)
{
	if (lPtr->image != NULL)
		WMReleasePixmap(lPtr->image);

	if (image)
		lPtr->image = WMRetainPixmap(image);
	else
		lPtr->image = NULL;

	if (lPtr->view->flags.realized) {
		paintLabel(lPtr);
	}
}
コード例 #9
0
ファイル: wlabel.c プロジェクト: awmaker/awmaker
void WMSetLabelText(WMLabel * lPtr, const char *text)
{
	if (lPtr->caption)
		wfree(lPtr->caption);

	if (text != NULL) {
		lPtr->caption = wstrdup(text);
	} else {
		lPtr->caption = NULL;
	}
	if (lPtr->view->flags.realized) {
		paintLabel(lPtr);
	}
}
コード例 #10
0
ファイル: wlabel.c プロジェクト: awmaker/awmaker
static void handleEvents(XEvent * event, void *data)
{
	Label *lPtr = (Label *) data;

	CHECK_CLASS(data, WC_Label);

	switch (event->type) {
	case Expose:
		if (event->xexpose.count != 0)
			break;
		paintLabel(lPtr);
		break;

	case DestroyNotify:
		destroyLabel(lPtr);
		break;
	}
}
コード例 #11
0
void paintDialog(AppInfo *app)
{
   DialogInfo *d = app->dialog;
   Drawable draw = d->dialogWindow;
   int i;
   
   XSetForeground(app->dpy, app->fillGC, d->w3.w.background);
   XFillRectangle(app->dpy, draw, app->fillGC, 0, 0,
		  d->w3.w.width, d->w3.w.height);
   if (d->w3.shadowThickness > 0) {
      draw_shaded_rectangle(app->dpy, draw, 0, 0,
			    d->w3.w.width, d->w3.w.height,
			    d->w3.shadowThickness,
			    d->w3.topShadowColor,
			    d->w3.bottomShadowColor);
   }
   paintLabel(app, draw, d->label);
   for (i = 0; i < d->indicator.count; i++) {
      paintIndicator(app, draw, d->indicators[i]);
   }
   paintButton(app, draw, d->okButton);
   paintButton(app, draw, d->cancelButton);
   XSync(app->dpy, False);
}
コード例 #12
0
void paintButton(AppInfo *app, Drawable draw, ButtonInfo button)
{
   Position x;
   Position y;
   Dimension width;
   Dimension height;
   
   if (button.w3.borderWidth > 0) {
      XSetForeground(app->dpy, app->borderGC, button.w3.borderColor);
      XFillRectangle(app->dpy, draw, app->borderGC, button.w3.w.x,
		     button.w3.w.y, button.w3.w.width, button.w3.w.height);
   }
   if ((button.w3.shadowThickness <= 0) && (button.pressed)) {
      Pixel tmp = button.w3.w.background;
      button.w3.w.background = button.w3.w.foreground;
      button.w3.w.foreground = tmp;
      tmp = button.label.w.background;
      button.label.w.background = button.label.w.foreground;
      button.label.w.foreground = tmp;
   }
   x = (button.w3.w.x + button.w3.borderWidth);
   y = (button.w3.w.y + button.w3.borderWidth);
   width = (button.w3.w.width - (2 * button.w3.borderWidth));
   height = (button.w3.w.height - (2 * button.w3.borderWidth));
   if ((button.w3.shadowThickness > 0) && (button.pressed)) {
      XSetForeground(app->dpy, app->fillGC, button.w3.topShadowColor);
   } else {
      XSetForeground(app->dpy, app->fillGC, button.w3.w.background);
   }
   XFillRectangle(app->dpy, draw, app->fillGC, x, y, width, height);
   if (button.w3.shadowThickness > 0) {
      if (button.pressed) {
	 draw_shaded_rectangle(app->dpy, draw, x, y, width, height,
			       button.w3.shadowThickness,
			       button.w3.bottomShadowColor,
			       button.w3.topShadowColor);
      } else {
	 draw_shaded_rectangle(app->dpy, draw, x, y, width, height,
			       button.w3.shadowThickness,
			       button.w3.topShadowColor,
			       button.w3.bottomShadowColor);
      }
   }
   if ((button.w3.shadowThickness > 0) && (button.pressed)) {
      Dimension pressedAdjustment;
      
      pressedAdjustment = button.w3.shadowThickness / 2;
      if (pressedAdjustment < 1) {
	 pressedAdjustment = 1;
      }
      x = button.label.w.x;
      y = button.label.w.y;
      button.label.w.x += pressedAdjustment;
      button.label.w.y += pressedAdjustment;
      paintLabel(app, draw, button.label);
      button.label.w.x = x;
      button.label.w.y = y;
   } else {
      paintLabel(app, draw, button.label);
   }
   if ((button.w3.shadowThickness <= 0) && (button.pressed)) {
      Pixel tmp = button.w3.w.background;
      button.w3.w.background = button.w3.w.foreground;
      button.w3.w.foreground = tmp;
      tmp = button.label.w.background;
      button.label.w.background = button.label.w.foreground;
      button.label.w.foreground = tmp;
   }
}