Some adjustments so setting FL_NORMAL_SIZE to 12 looks better

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1065 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Bill Spitzak 2000-04-12 04:32:05 +00:00
parent ffd26dfc45
commit e0118f6a16
2 changed files with 25 additions and 27 deletions

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Menu.cxx,v 1.18.2.3 2000/04/11 08:11:52 bill Exp $"
// "$Id: Fl_Menu.cxx,v 1.18.2.4 2000/04/12 04:32:04 bill Exp $"
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
@ -148,7 +148,7 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m,
x += 3;
w -= 8;
} else {
fl_draw_box(b, x+1, y-1, w-2, h+2, r);
fl_draw_box(b, x+1, y-(LEADING-2)/2, w-2, h+(LEADING-2), r);
}
}
@ -249,7 +249,7 @@ menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp,
if (!Wp) {if (X < 0) X = 0; if (X > Fl::w()-W) X= Fl::w()-W;}
x(X); w(W);
h((numitems ? itemheight*numitems-LEADING : 0)+2*BW+5);
h((numitems ? itemheight*numitems-LEADING : 0)+2*BW+3);
if (selected >= 0)
Y = Y+(Hp-itemheight)/2-selected*itemheight-BW;
else
@ -296,12 +296,12 @@ void menuwindow::drawentry(const Fl_Menu_Item* m, int i, int erase) {
int x = BW;
int W = this->w();
int w = W-2*BW-1;
int y = BW+2+i*itemheight;
int y = BW+1+i*itemheight;
int h = itemheight - LEADING;
if (erase && i != selected) {
fl_color(button ? button->color() : FL_GRAY);
fl_rectf(x+1, y-1, w-2, h+2);
fl_rectf(x+1, y-(LEADING-2)/2, w-2, h+(LEADING-2));
}
m->draw(x, y, w, h, button, i==selected);
@ -320,9 +320,9 @@ void menuwindow::drawentry(const Fl_Menu_Item* m, int i, int erase) {
if (m->flags & FL_MENU_DIVIDER) {
fl_color(FL_DARK3);
fl_xyline(BW-1, y+h+1, W-2*BW+2);
fl_xyline(BW-1, y+h+(LEADING-2)/2, W-2*BW+2);
fl_color(FL_LIGHT3);
fl_xyline(BW-1, y+h+2, W-2*BW+2);
fl_xyline(BW-1, y+h+((LEADING-2)/2+1), W-2*BW+2);
}
}
@ -736,5 +736,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
}
//
// End of "$Id: Fl_Menu.cxx,v 1.18.2.3 2000/04/11 08:11:52 bill Exp $".
// End of "$Id: Fl_Menu.cxx,v 1.18.2.4 2000/04/12 04:32:04 bill Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: fl_ask.cxx,v 1.8.2.3 2000/03/05 06:51:07 bill Exp $"
// "$Id: fl_ask.cxx,v 1.8.2.4 2000/04/12 04:32:05 bill Exp $"
//
// Standard dialog functions for the Fast Light Tool Kit (FLTK).
//
@ -52,19 +52,19 @@ static Fl_Button *button[3];
static Fl_Input *input;
static char *iconlabel = "?";
uchar fl_message_font_ = 0;
uchar fl_message_size_ = FL_NORMAL_SIZE;
uchar fl_message_size_ = 14;
static Fl_Window *makeform() {
if (message_form) {
message_form->size(410,105);
message_form->size(410,103);
return message_form;
}
Fl_Window *w = message_form = new Fl_Window(410,105);
Fl_Window *w = message_form = new Fl_Window(410,103);
// w->clear_border();
// w->box(FL_UP_BOX);
(message = new Fl_Box(60, 25, 340, 20))
->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_WRAP);
(input = new Fl_Input(60,32,340,30))->hide();
(input = new Fl_Input(60, 37, 340, 23))->hide();
{Fl_Box* o = icon = new Fl_Box(10, 10, 50, 50);
o->box(FL_THIN_UP_BOX);
o->labelfont(FL_TIMES_BOLD);
@ -72,10 +72,10 @@ static Fl_Window *makeform() {
o->color(FL_WHITE);
o->labelcolor(FL_BLUE);
}
(button[0] = new Fl_Button(310, 70, 90, 25))->shortcut("^[");
button[1] = new Fl_Return_Button(210, 70, 90, 25);
button[2] = new Fl_Button(110, 70, 90, 25);
w->resizable(new Fl_Box(60,10,110-60,22));
(button[0] = new Fl_Button(310, 70, 90, 23))->shortcut("^[");
button[1] = new Fl_Return_Button(210, 70, 90, 23);
button[2] = new Fl_Button(110, 70, 90, 23);
w->resizable(new Fl_Box(60,10,110-60,27));
w->end();
w->set_modal();
return w;
@ -90,8 +90,7 @@ int vsnprintf(char* str, size_t size, const char* fmt, va_list ap);
static int innards(const char* fmt, va_list ap,
const char *b0,
const char *b1,
const char *b2,
const char *l)
const char *b2)
{
makeform();
char buffer[1024];
@ -104,7 +103,7 @@ static int innards(const char* fmt, va_list ap,
Fl_Font f = (Fl_Font)fl_message_font_;
message->labelfont(f);
message->labelsize(fl_message_size_);
if (b0) {button[0]->show();button[0]->label(b0);button[1]->position(210,70);}
if (b0) {button[0]->show(); button[0]->label(b0); button[1]->position(210,70);}
else {button[0]->hide(); button[1]->position(310,70);}
if (b1) {button[1]->show(); button[1]->label(b1);}
else button[1]->hide();
@ -113,7 +112,6 @@ static int innards(const char* fmt, va_list ap,
const char* prev_icon_label = icon->label();
if (!prev_icon_label) icon->label(iconlabel);
message_form->hotspot(button[0]);
message_form->label(l);
message_form->show();
int r;
for (;;) {
@ -146,7 +144,7 @@ void fl_message(const char *fmt, ...) {
va_start(ap, fmt);
iconlabel = "i";
innards(fmt, ap, 0, fl_ok, 0, "Message");
innards(fmt, ap, 0, fl_ok, 0);
va_end(ap);
iconlabel = "?";
}
@ -163,7 +161,7 @@ void fl_alert(const char *fmt, ...) {
va_start(ap, fmt);
iconlabel = "!";
innards(fmt, ap, 0, fl_ok, 0, "Alert");
innards(fmt, ap, 0, fl_ok, 0);
va_end(ap);
iconlabel = "?";
}
@ -176,7 +174,7 @@ int fl_ask(const char *fmt, ...) {
#endif // WIN32
va_start(ap, fmt);
int r = innards(fmt, ap, fl_no, fl_yes, 0, "Question");
int r = innards(fmt, ap, fl_no, fl_yes, 0);
va_end(ap);
return r;
@ -190,7 +188,7 @@ int fl_choice(const char*fmt,const char *b0,const char *b1,const char *b2,...){
#endif // WIN32
va_start(ap, b2);
int r = innards(fmt, ap, b0, b1, b2, "Choose");
int r = innards(fmt, ap, b0, b1, b2);
va_end(ap);
return r;
}
@ -209,7 +207,7 @@ static const char* input_innards(const char* fmt, va_list ap,
MessageBeep(MB_ICONQUESTION);
#endif // WIN32
int r = innards(fmt, ap, fl_cancel, fl_ok, 0, "Input");
int r = innards(fmt, ap, fl_cancel, fl_ok, 0);
input->hide();
message->position(60,25);
return r ? input->value() : 0;
@ -232,5 +230,5 @@ const char *fl_password(const char *fmt, const char *defstr, ...) {
}
//
// End of "$Id: fl_ask.cxx,v 1.8.2.3 2000/03/05 06:51:07 bill Exp $".
// End of "$Id: fl_ask.cxx,v 1.8.2.4 2000/04/12 04:32:05 bill Exp $".
//