/[hegemonie]/hegemonie/Resources/Theme/UiButtonTheme.m
ViewVC logotype

Diff of /hegemonie/Resources/Theme/UiButtonTheme.m

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by zaral, Thu Aug 28 12:03:53 2003 UTC revision 1.5 by dam, Mon Sep 8 14:04:53 2003 UTC
# Line 21  Line 21 
21   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22   */   */
23    
 #include <stdio.h>  
24  #include <GL/gl.h>  #include <GL/gl.h>
25    
26    #include <Foundation/NSGeometry.h>
27    
28  #include "Interface/UiButton.h"  #include "Interface/UiButton.h"
29    #include "DrawFuncs.h"
30    
31  #define BORDERSIZE 5  #define BORDERSIZE 5.0f
32    
33  @interface UiButton (Theme)  @interface UiButton (Theme)
34    
# Line 39  Line 41 
41    
42  - (void) _displayRect: (NSRect)rect  - (void) _displayRect: (NSRect)rect
43  {  {
44      draw_button (0.0f, NSWidth ([self frame]),
45                   0.0f, NSHeight ([self frame]),
46                   BORDERSIZE / 2.0f);
47    
48    /* Tell the container to display his widgets */    /* Tell the container to display his widgets */
49    glPushMatrix ();    glPushMatrix ();
50    glTranslatef (BORDERSIZE, BORDERSIZE, 0.0f);    glTranslatef (BORDERSIZE, BORDERSIZE, 0.0f);
51    [super _displayRect: rect];    [super _displayRect: rect];
52    glPopMatrix ();    glPopMatrix ();
   
   /* Sets the color to white */  
   glColor3f (1.0f, 1.0f, 1.0f);  
     
   /* enables stripple lines */  
   glEnable (GL_LINE_STIPPLE);  
     
   /* sets the line to be stippled to dash */  
   glLineStipple (1, 0xAAAA);  
     
   /* draw the border */  
   NSRect rectangle = [self frame];  
   
   glBegin (GL_LINE_LOOP);  
   glVertex2f (0.0f, 0.0f);  
   glVertex2f (0.0f, NSHeight (rectangle));  
   glVertex2f (NSWidth (rectangle), NSHeight (rectangle));  
   glVertex2f (NSWidth (rectangle), 0.0f);  
   glEnd ();  
   
   glDisable (GL_LINE_STIPPLE);  
53  }  }
54    
55  - (void) sizeToFit  - (void) sizeToFit
# Line 72  Line 57 
57    [super sizeToFit];    [super sizeToFit];
58        
59    /* add the size of the border to the size of the button */    /* add the size of the border to the size of the button */
60    [self setSize: NSMakeSize (NSWidth ([self frame]) + 2 * BORDERSIZE,    [self setSize: NSMakeSize (NSWidth ([self frame]) + 2.0f * BORDERSIZE,
61                               NSHeight ([self frame]) + 2 * BORDERSIZE)];                               NSHeight ([self frame]) + 2.0f * BORDERSIZE)];
62  }  }
63    
64  @end  @end

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26