86 FXint tw=0,th=0,iw=0,ih=0,tx,ty,ix,iy;
87 FXEvent*ev=(FXEvent*)ptr;
88 FXDCWindow dc(
this,ev);
91 FXColor top = FXRGB(0xfe,0xfd,0xfd);
92 FXColor bottom = FXRGB(0xdd,0xd7,0xce);
93 FXColor shade = FXRGB(0xdc,0xd9,0xd4);
97 FXColor bordercolor = FXRGB(123,158,189);
105 FXPoint basebackground[4]= {FXPoint(0,0),FXPoint(width-1,0),FXPoint(0,height-1),FXPoint(width-1,height-1)};
107 FXPoint bordershade[16]= {
108 FXPoint(0,1),FXPoint(1,0),FXPoint(1,2),FXPoint(2,1),
109 FXPoint(width-2,0),FXPoint(width-1,1),FXPoint(width-3,1),FXPoint(width-2,2),
110 FXPoint(0,height-2),FXPoint(1,height-1),FXPoint(1,height-3),FXPoint(2,height-2),
111 FXPoint(width-1,height-2),FXPoint(width-2,height-1),FXPoint(width-2,height-3),FXPoint(width-3,height-2)
113 FXPoint bordercorners[4]= {
114 FXPoint(1,1),FXPoint(1,height-2),FXPoint(width-2,1),FXPoint(width-2,height-2)
118 if (options&BUTTON_TOOLBAR && !underCursor()) {
119 dc.setForeground(baseColor);
120 dc.fillRectangle(0,0,width,height);
122 else if (state==STATE_UP && ((options&BUTTON_TOOLBAR)==0 || (options&BUTTON_TOOLBAR && underCursor()))) {
124 dc.setForeground(baseColor);
125 dc.drawPoints(basebackground,4);
127 dc.setForeground(bordercolor);
128 dc.drawRectangle(2,0,width-5,0);
129 dc.drawRectangle(2,height-1,width-5,height-1);
130 dc.drawRectangle(0,2,0,height-5);
131 dc.drawRectangle(width-1,2,width-1,height-5);
132 dc.drawPoints(bordercorners,4);
133 dc.setForeground(shade);
134 dc.drawPoints(bordershade,16);
137 dc.setForeground(top);
138 dc.drawRectangle(1,3,0,height-7);
139 dc.setForeground(bottom);
140 dc.drawRectangle(width-2,3,0,height-7);
144 dc.setForeground(baseColor);
145 dc.drawPoints(basebackground,4);
147 dc.setForeground(bordercolor);
148 dc.drawRectangle(2,0,width-5,0);
149 dc.drawRectangle(2,height-1,width-5,height-1);
150 dc.drawRectangle(0,2,0,height-5);
151 dc.drawRectangle(width-1,2,width-1,height-5);
152 dc.drawPoints(bordercorners,4);
153 dc.setForeground(shade);
154 dc.drawPoints(bordershade,16);
156 dc.setForeground(FXRGB(0xdc,0xd4,0xc9));
157 dc.fillRectangle(2,1,width-4,height-2);
162 tw=labelWidth(label);
163 th=labelHeight(label);
167 ih=icon->getHeight();
174 if (state && (options&(FRAME_RAISED|FRAME_SUNKEN))) {
184 dc.drawIcon(icon,ix,iy);
188 dc.setForeground(textColor);
189 drawLabel(dc,label,hotoff,tx,ty,tw,th);
192 dc.drawFocusRectangle(border+1,border+1,width-2*border-2,height-2*border-2);
199 dc.drawIconSunken(icon,ix,iy);
203 dc.setForeground(hiliteColor);
204 drawLabel(dc,label,hotoff,tx+1,ty+1,tw,th);
205 dc.setForeground(shadowColor);
206 drawLabel(dc,label,hotoff,tx,ty,tw,th);
508 FXint tw=0,th=0,iw=0,ih=0,tx,ty,ix,iy;
509 FXEvent *ev=(FXEvent*)ptr;
511 FXDCWindow dc(
this,ev);
517 FXColor top = FXRGB(0xde,0xe7,0xff);
518 FXColor bottom = FXRGB(0xbd,0xcf,0xff);
519 FXColor shade = FXRGB(0xbd,0xcb,0xf7);
521 FXColor buttoncolor = FXRGB(0x4a,0x61,0x84);
524 FXColor bordercolor = shade;
526 FXPoint basebackground[4]= {
527 FXPoint(0,0),FXPoint(width-1,0),FXPoint(0,height-1),FXPoint(width-1,height-1)
529 FXPoint bordershade[16]= {
530 FXPoint(0,1),FXPoint(1,0),FXPoint(1,2),FXPoint(2,1),
531 FXPoint(width-2,0),FXPoint(width-1,1),FXPoint(width-3,1),FXPoint(width-2,2),
532 FXPoint(0,height-2),FXPoint(1,height-1),FXPoint(1,height-3),FXPoint(2,height-2),
533 FXPoint(width-1,height-2),FXPoint(width-2,height-1),FXPoint(width-2,height-3),FXPoint(width-3,height-2)
535 FXPoint bordercorners[4]= {
536 FXPoint(1,1),FXPoint(1,height-2),FXPoint(width-2,1),FXPoint(width-2,height-2)
541 if (options&(FRAME_RAISED|FRAME_SUNKEN)) {
544 if (options&MENUBUTTON_TOOLBAR) {
547 if (isEnabled() && underCursor() && !state) {
548 dc.setForeground(backColor);
549 dc.fillRectangle(border,border,width-border*2,height-border*2);
550 if(options&FRAME_THICK) drawDoubleRaisedRectangle(dc,0,0,width,height);
551 else drawRaisedRectangle(dc,0,0,width,height);
555 else if (isEnabled() && state) {
556 dc.setForeground(hiliteColor);
557 dc.fillRectangle(border,border,width-border*2,height-border*2);
558 if(options&FRAME_THICK) drawDoubleSunkenRectangle(dc,0,0,width,height);
559 else drawSunkenRectangle(dc,0,0,width,height);
564 dc.setForeground(backColor);
565 dc.fillRectangle(0,0,width,height);
572 if (!isEnabled() || !state) {
580 dc.setForeground(baseColor);
581 dc.drawPoints(basebackground,4);
583 dc.setForeground(bordercolor);
584 dc.drawRectangle(2,0,width-5,0);
585 dc.drawRectangle(2,height-1,width-5,height-1);
586 dc.drawRectangle(0,2,0,height-5);
587 dc.drawRectangle(width-1,2,0,height-5);
588 dc.drawPoints(bordercorners,4);
589 dc.setForeground(shade);
590 dc.drawPoints(bordershade,16);
593 dc.setForeground(top);
594 dc.drawRectangle(1,3,0,height-7);
595 dc.setForeground(bottom);
596 dc.drawRectangle(width-2,3,0,height-7);
601 dc.setForeground(baseColor);
602 dc.drawPoints(basebackground,4);
604 dc.setForeground(bordercolor);
605 dc.drawRectangle(2,0,width-5,0);
606 dc.drawRectangle(2,height-1,width-5,height-1);
607 dc.drawRectangle(0,2,0,height-5);
608 dc.drawRectangle(width-1,2,0,height-5);
609 dc.drawPoints(bordercorners,4);
610 dc.setForeground(shade);
611 dc.drawPoints(bordershade,16);
613 dc.setForeground(FXRGB(0xdc,0xd4,0xc9));
614 dc.fillRectangle(2,1,width-4,height-2);
621 if(isEnabled() && state) {
622 dc.setForeground(hiliteColor);
623 dc.fillRectangle(0,0,width,height);
626 dc.setForeground(backColor);
627 dc.fillRectangle(0,0,width,height);
632 if (!label.empty()) {
633 tw=labelWidth(label);
634 th=labelHeight(label);
640 ih=icon->getHeight();
644 else if(!(options&MENUBUTTON_NOARROWS)) {
645 if(options&MENUBUTTON_LEFT) {
670 dc.drawIcon(icon,ix,iy);
672 dc.drawIconSunken(icon,ix,iy);
676 else if (!(options&MENUBUTTON_NOARROWS)) {
679 if ((options&MENUBUTTON_RIGHT)==MENUBUTTON_RIGHT) {
681 dc.setForeground(buttoncolor);
683 dc.setForeground(shadowColor);
690 dc.fillPolygon(points,3);
694 else if (options&MENUBUTTON_LEFT) {
696 dc.setForeground(buttoncolor);
698 dc.setForeground(shadowColor);
705 dc.fillPolygon(points,3);
709 else if (options&MENUBUTTON_UP) {
711 dc.setForeground(buttoncolor);
713 dc.setForeground(shadowColor);
720 dc.fillPolygon(points,3);
726 dc.setForeground(buttoncolor);
728 dc.setForeground(shadowColor);
741 dc.fillConcavePolygon(points,6);
746 if (!label.empty()) {
749 dc.setForeground(textColor);
750 drawLabel(dc,label,hotoff,tx,ty,tw,th);
753 dc.setForeground(hiliteColor);
754 drawLabel(dc,label,hotoff,tx+1,ty+1,tw,th);
755 dc.setForeground(shadowColor);
756 drawLabel(dc,label,hotoff,tx,ty,tw,th);
763 dc.drawFocusRectangle(border+1,border+1,width-2*border-2,height-2*border-2);
823 register FXint tx,ty,tw,th,ix,iy,iw,ih,s,ml,mr,mt,mb,beg,end,t,xx,yy,bb,aa,ax,ay;
824 register FXFont *font=header->getFont();
825 FXColor top = FXRGB(0xfe,0xfd,0xfd);
826 FXColor bottom = FXRGB(0xdd,0xd7,0xce);
827 FXColor shade = FXRGB(0xdc,0xd9,0xd4);
830 bb=header->getBorderWidth();
831 ml=header->getPadLeft()+bb;
832 mr=header->getPadRight()+bb;
833 mt=header->getPadTop()+bb;
834 mb=header->getPadBottom()+bb;
836 dc.setForeground(shade);
847 dc.setClipRectangle(x,y,w,h);
849 dc.setForeground(header->getTextColor());
854 while(end<label.length() && label[end]!=
'\n') end++;
855 if((t=font->getTextWidth(&label[beg],end-beg))>tw) tw=t;
856 th+=font->getFontHeight();
859 while(end<label.length());
864 ih=icon->getHeight();
872 if (state&(ARROW_UP|ARROW_DOWN)) {
873 aa=(font->getFontHeight()-5)|1;
877 dc.setForeground(header->getHiliteColor());
878 dc.drawLine(ax+aa/2,ay,ax+aa-1,ay+aa);
879 dc.drawLine(ax,ay+aa,ax+aa,ay+aa);
880 dc.setForeground(header->getShadowColor());
881 dc.drawLine(ax+aa/2,ay,ax,ay+aa);
884 dc.setForeground(header->getHiliteColor());
885 dc.drawLine(ax+aa/2,ay+aa,ax+aa-1,ay);
886 dc.setForeground(header->getShadowColor());
887 dc.drawLine(ax+aa/2,ay+aa,ax,ay);
888 dc.drawLine(ax,ay,ax+aa,ay);
891 dc.setClipRectangle(x,y,w,h);
900 else if (state&AFTER) {
909 else if(state&RIGHT) {
914 else if (state&AFTER) {
928 else if (state&AFTER) {
944 else if (state&BELOW) {
953 else if(state&BOTTOM) {
958 else if (state&BELOW) {
972 else if (state&BELOW) {
992 dc.drawIcon(icon,ix,iy);
996 dc.setForeground(header->getTextColor());
999 yy=ty+font->getFontAscent();
1003 while(end<label.length() && label[end]!=
'\n')
1007 else if(state&RIGHT)
1008 xx=tx+tw-font->getTextWidth(&label[beg],end-beg);
1010 xx=tx+(tw-font->getTextWidth(&label[beg],end-beg))/2;
1011 dc.drawText(xx,yy,&label[beg],end-beg);
1012 yy+=font->getFontHeight();
1015 while(end<label.length());
1018 dc.clearClipRectangle();