mirror of
https://github.com/fltk/fltk.git
synced 2026-05-31 22:04:26 +08:00
Tweak gtk+ drawing of Fl_Choice.
Add support for "-Dname" option in fltk-config. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5484 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -118,6 +118,7 @@ Options telling what information we request:
|
|||||||
|
|
||||||
Option to compile and link an application:
|
Option to compile and link an application:
|
||||||
[-g] compile the program with debugging information
|
[-g] compile the program with debugging information
|
||||||
|
[-Dname[=value]] compile the program with the given define
|
||||||
[--compile program.cxx]
|
[--compile program.cxx]
|
||||||
[--post program]
|
[--post program]
|
||||||
"
|
"
|
||||||
@@ -185,6 +186,9 @@ do
|
|||||||
-g)
|
-g)
|
||||||
debug=-g
|
debug=-g
|
||||||
;;
|
;;
|
||||||
|
-D*)
|
||||||
|
CXXFLAGS="$CXXFLAGS $1"
|
||||||
|
;;
|
||||||
--compile)
|
--compile)
|
||||||
compile=$2
|
compile=$2
|
||||||
post=$2
|
post=$2
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <FL/Fl.H>
|
#include <FL/Fl.H>
|
||||||
#include <FL/Fl_Choice.H>
|
#include <FL/Fl_Choice.H>
|
||||||
#include <FL/fl_draw.H>
|
#include <FL/fl_draw.H>
|
||||||
|
#include "flstring.h"
|
||||||
|
|
||||||
// Emulates the Forms choice widget. This is almost exactly the same
|
// Emulates the Forms choice widget. This is almost exactly the same
|
||||||
// as an Fl_Menu_Button. The only difference is the appearance of the
|
// as an Fl_Menu_Button. The only difference is the appearance of the
|
||||||
@@ -48,8 +49,23 @@ void Fl_Choice::draw() {
|
|||||||
draw_box(FL_UP_BOX, color());
|
draw_box(FL_UP_BOX, color());
|
||||||
|
|
||||||
fl_color(active_r() ? labelcolor() : fl_inactive(labelcolor()));
|
fl_color(active_r() ? labelcolor() : fl_inactive(labelcolor()));
|
||||||
|
if (!strcmp(Fl::scheme(), "plastic")) {
|
||||||
|
// Show larger up/down arrows...
|
||||||
fl_polygon(x1, y1 + 3, x1 + w1, y1 + w1 + 3, x1 + 2 * w1, y1 + 3);
|
fl_polygon(x1, y1 + 3, x1 + w1, y1 + w1 + 3, x1 + 2 * w1, y1 + 3);
|
||||||
fl_polygon(x1, y1 + 1, x1 + w1, y1 - w1 + 1, x1 + 2 * w1, y1 + 1);
|
fl_polygon(x1, y1 + 1, x1 + w1, y1 - w1 + 1, x1 + 2 * w1, y1 + 1);
|
||||||
|
} else {
|
||||||
|
// Show smaller up/down arrows with a divider...
|
||||||
|
x1 = x() + w() - 13 - dx;
|
||||||
|
y1 = y() + h() / 2;
|
||||||
|
fl_polygon(x1, y1 - 2, x1 + 3, y1 - 5, x1 + 6, y1 - 2);
|
||||||
|
fl_polygon(x1, y1 + 2, x1 + 3, y1 + 5, x1 + 6, y1 + 2);
|
||||||
|
|
||||||
|
fl_color(fl_darker(color()));
|
||||||
|
fl_yxline(x1 - 7, y1 - 8, y1 + 8);
|
||||||
|
|
||||||
|
fl_color(fl_lighter(color()));
|
||||||
|
fl_yxline(x1 - 6, y1 - 8, y1 + 8);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
draw_box(FL_DOWN_BOX, FL_BACKGROUND2_COLOR);
|
draw_box(FL_DOWN_BOX, FL_BACKGROUND2_COLOR);
|
||||||
draw_box(FL_UP_BOX,X,Y,W,H,color());
|
draw_box(FL_UP_BOX,X,Y,W,H,color());
|
||||||
|
|||||||
Reference in New Issue
Block a user