- Added button align code:
uiBlockBeginAlign(block, 'v'); 'v'= vertical. 'h'=horizontal ..... (button def calls) uiBlockEndAlign(block); this will allow new themes to have buttons nicely drawn together. - added new rounded draw theme, to test & illustrate the above. - only did parts of button code with align... rest for later - fixed 'minimal' theme to make it usable (with some decoration) - put back 'oldskool' theme... but it just looks plain ugly! remove? Lazy people: http://www.blender.org/bf/rt.jpg check the top header, or Nkey menu, to see the meaning of 'align'.
This commit is contained in:
@@ -74,6 +74,7 @@ struct ScrArea;
|
||||
#define UI_BLOCK_BUSY 8
|
||||
#define UI_BLOCK_NUMSELECT 16
|
||||
#define UI_BLOCK_ENTER_OK 32
|
||||
/* block->flag bits 12-15 are identical to but->flag bits */
|
||||
|
||||
/* block->font, for now: bold = medium+1 */
|
||||
#define UI_HELV 0
|
||||
@@ -100,6 +101,13 @@ struct ScrArea;
|
||||
#define UI_MAKE_RIGHT 1024
|
||||
/* dont draw hilite on mouse over */
|
||||
#define UI_NO_HILITE 2048
|
||||
/* button align flag, for drawing groups together */
|
||||
#define UI_BUT_ALIGN (15<<12)
|
||||
#define UI_BUT_ALIGN_TOP (1<<12)
|
||||
#define UI_BUT_ALIGN_LEFT (1<<13)
|
||||
#define UI_BUT_ALIGN_RIGHT (1<<14)
|
||||
#define UI_BUT_ALIGN_DOWN (1<<15)
|
||||
|
||||
|
||||
/* Button types */
|
||||
#define CHA 32
|
||||
@@ -166,6 +174,10 @@ void uiFreeBlocks(struct ListBase *lb);
|
||||
void uiFreeBlocksWin(struct ListBase *lb, int win);
|
||||
uiBlock *uiNewBlock(struct ListBase *lb, char *name, short dt, short font, short win);
|
||||
uiBlock *uiGetBlock(char *name, struct ScrArea *sa);
|
||||
|
||||
void uiBlockBeginAlign(uiBlock *block, char dir);
|
||||
void uiBlockEndAlign(uiBlock *block);
|
||||
|
||||
uiBut *uiDefBut(uiBlock *block,
|
||||
int type, int retval, char *str,
|
||||
short x1, short y1,
|
||||
|
||||
@@ -111,8 +111,9 @@ typedef struct {
|
||||
|
||||
struct uiBut {
|
||||
uiBut *next, *prev;
|
||||
short type, pointype, bit, bitnr, retval, flag, strwidth, ofs, pos;
|
||||
|
||||
short type, pointype, bit, bitnr, retval, strwidth, ofs, pos;
|
||||
int flag;
|
||||
|
||||
char *str;
|
||||
char strdata[UI_MAX_NAME_STR];
|
||||
char drawstr[UI_MAX_DRAW_STR];
|
||||
@@ -182,13 +183,12 @@ struct uiBlock {
|
||||
void (*drawextra)();
|
||||
|
||||
int themecol; /* themecolor id */
|
||||
short but_align; /* aligning buttons, horiz/vertical */
|
||||
|
||||
short font; /* indices */
|
||||
int afterval;
|
||||
int afterval, flag;
|
||||
void *curfont;
|
||||
|
||||
short autofill, flag, win, winq, direction, dt, frontbuf, auto_open; //frontbuf see below
|
||||
short autofill, win, winq, direction, dt, frontbuf, auto_open; //frontbuf see below
|
||||
void *saveunder;
|
||||
|
||||
float xofs, yofs; // offset to parent button
|
||||
@@ -208,6 +208,7 @@ extern void ui_window_to_graphics(int win, float *x, float *y);
|
||||
/* interface_panel.c */
|
||||
extern void ui_draw_panel(uiBlock *block);
|
||||
extern void ui_do_panel(uiBlock *block, uiEvent *uevent);
|
||||
extern void gl_round_box(float minx, float miny, float maxx, float maxy, float rad);
|
||||
|
||||
/* interface_draw.c */
|
||||
extern void ui_set_embossfunc(uiBut *but, int drawtype);
|
||||
|
||||
Reference in New Issue
Block a user