void draw_string(_param p) { double a, r, x, y; _point *O; _set *s; check_font(); a = POPn; r = DEFAULT_DIST*local_size; if (p.addr) { s = POP(_set); O = get_point(&s); x = O->x; y = O->y; O = get_point(&s); x = (x + O->x)/2 + r*Cos(a); y = (y + O->y)/2 + r*Sin(a); } else { O = POP(_point); x = O->x + r*Cos(a); y = O->y + r*Sin(a); } fprintf(output_file, "\\rput(%.4f,%.4f){", x, y); put_font(); fprintf(output_file, "%s}\n", POPs); }
void GUIButton::Draw(Bitmap *ds) { bool draw_disabled = !IsEnabled(); check_font(&Font); // if it's "Unchanged when disabled" or "GUI Off", don't grey out if (gui_disabled_style == GUIDIS_UNCHANGED || gui_disabled_style == GUIDIS_GUIOFF) { draw_disabled = false; } // TODO: should only change properties in reaction to particular events if (CurrentImage <= 0 || draw_disabled) CurrentImage = Image; if (draw_disabled && gui_disabled_style == GUIDIS_BLACKOUT) // buttons off when disabled - no point carrying on return; // CHECKME: why testing both CurrentImage and Image? if (CurrentImage > 0 && Image > 0) DrawImageButton(ds, draw_disabled); // CHECKME: why don't draw frame if no Text? this will make button completely invisible! else if (!_text.IsEmpty()) DrawTextButton(ds, draw_disabled); }
void label_point(_param p) { double a, r; _symbol *s; _point *O; check_font(); a = POPn; r = DEFAULT_DIST*local_size; s = (_symbol *)p.ptr; O = s->content->value.point; fprintf(output_file, "\\rput(%.4f,%.4f){", O->x + r*Cos(a), O->y + r*Sin(a)); put_font(); fprintf(output_file, "$%s$}\n", s->symbol); }
void GUITextBox::Draw(Bitmap *ds) { check_font(&Font); color_t text_color = ds->GetCompatibleColor(TextColor); color_t draw_color = ds->GetCompatibleColor(TextColor); if (IsBorderShown()) { ds->DrawRect(RectWH(X, Y, Width, Height), draw_color); if (1 > 1) { ds->DrawRect(Rect(X + 1, Y + 1, X + Width - 1, Y + Height - 1), draw_color); } } DrawTextBoxContents(ds, text_color); }
HostDialog::HostDialog(Config *config,QWidget *parent) : QDialog(parent) { host_config=config; host_id=-1; QFont check_font("helvetica",12,QFont::Bold); check_font.setPixelSize(12); QFont label_font("helvetica",14,QFont::Bold); label_font.setPixelSize(14); QFont button_font("helvetica",16,QFont::Bold); button_font.setPixelSize(16); host_label_label=new QLabel(tr("Label")+":",this); host_label_label->setFont(label_font); host_label_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); host_label_edit=new QLineEdit(this); host_hostname_label=new QLabel(tr("Hostname")+":",this); host_hostname_label->setFont(label_font); host_hostname_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); host_hostname_edit=new QLineEdit(this); host_password_label=new QLabel(tr("Password")+":",this); host_password_label->setFont(label_font); host_password_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); host_password_edit=new QLineEdit(this); host_password_edit->setEchoMode(QLineEdit::Password); host_color_label=new QLabel(tr("Color")+":",this); host_color_label->setFont(label_font); host_color_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); host_color_box=new ColorBox(this); host_autoconnect_check=new QCheckBox(this); host_autoconnect_label=new QLabel(tr("Autoconnect"),this); host_autoconnect_label->setFont(check_font); host_autoconnect_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); host_ok_button=new QPushButton(tr("OK"),this); host_ok_button->setFont(button_font); connect(host_ok_button,SIGNAL(clicked()),this,SLOT(okData())); host_cancel_button=new QPushButton(tr("Cancel"),this); host_cancel_button->setFont(button_font); connect(host_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData())); }