Revision: 21112
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21112
Author:   zaghaghi
Date:     2009-06-23 19:30:18 +0200 (Tue, 23 Jun 2009)

Log Message:
-----------
fix ui issues of space_logic

Modified Paths:
--------------
    
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
    
branches/blender2.5/blender/source/blender/editors/space_logic/logic_window.c

Modified: 
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
    2009-06-23 17:10:46 UTC (rev 21111)
+++ 
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
    2009-06-23 17:30:18 UTC (rev 21112)
@@ -1902,6 +1902,7 @@
                        break;
                        
                case UI_WTYPE_TOGGLE:
+                       wt.wcol_theme= &btheme->tui.wcol_radio;/*use radio 
theme for toggles*/
                        break;
                        
                case UI_WTYPE_OPTION:

Modified: 
branches/blender2.5/blender/source/blender/editors/space_logic/logic_window.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/space_logic/logic_window.c   
    2009-06-23 17:10:46 UTC (rev 21111)
+++ 
branches/blender2.5/blender/source/blender/editors/space_logic/logic_window.c   
    2009-06-23 17:30:18 UTC (rev 21112)
@@ -3056,12 +3056,12 @@
        /* ******************************* */
        xco= 500; yco= 170; width= 300;
 
-       uiDefPulldownBut(block, controller_menu, NULL, "Controllers", xco-10, 
yco+35, 100, 19, "");
+       uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, 
yco+35, 100, UI_UNIT_Y, "");
        
        uiBlockBeginAlign(block);
-       uiDefButBitS(block, TOG, BUTS_CONT_SEL,  B_REDR, "Sel", xco+110, 
yco+35, (width-100)/3, 19, &slogic->scaflag, 0, 0, 0, 0, "Show all selected 
Objects");
-       uiDefButBitS(block, TOG, BUTS_CONT_ACT, B_REDR, "Act", 
xco+110+(width-100)/3, yco+35, (width-100)/3, 19, &slogic->scaflag, 0, 0, 0, 0, 
"Show active Object");
-       uiDefButBitS(block, TOG, BUTS_CONT_LINK, B_REDR, "Link", 
xco+110+2*(width-100)/3, yco+35, (width-100)/3, 19, &slogic->scaflag, 0, 0, 0, 
0, "Show linked Objects to Sensor/Actuator");
+       uiDefButBitS(block, TOG, BUTS_CONT_SEL,  B_REDR, "Sel", xco+110, 
yco+35, (width-100)/3, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show all 
selected Objects");
+       uiDefButBitS(block, TOG, BUTS_CONT_ACT, B_REDR, "Act", 
xco+110+(width-100)/3, yco+35, (width-100)/3, UI_UNIT_Y, &slogic->scaflag, 0, 
0, 0, 0, "Show active Object");
+       uiDefButBitS(block, TOG, BUTS_CONT_LINK, B_REDR, "Link", 
xco+110+2*(width-100)/3, yco+35, (width-100)/3, UI_UNIT_Y, &slogic->scaflag, 0, 
0, 0, 0, "Show linked Objects to Sensor/Actuator");
        uiBlockEndAlign(block);
        
        ob= CTX_data_active_object(C);
@@ -3077,9 +3077,9 @@
                /* presume it is only objects for now */
                uiBlockBeginAlign(block);
 //             if(ob->controllers.first) uiSetCurFont(block, UI_HELVB);
-               uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, 
ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 0, 
0, 0, "Active Object name");
+               uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, 
ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 
0, 0, 0, 0, "Active Object name");
 //             if(ob->controllers.first) uiSetCurFont(block, UI_HELV);
-               uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, 
"Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new 
Controller");
+               uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, 
"Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add 
a new Controller");
                uiBlockEndAlign(block);
                yco-=20;
                
@@ -3100,7 +3100,7 @@
                if(ob->scaflag & OB_SHOWCONT) {
 
                        /* first show the state */
-                       uiDefBlockBut(block, object_state_mask_menu, ob, 
"State", (short)(xco-10), (short)(yco-10), 36, 19, "Object state menu: store 
and retrieve initial state");
+                       uiDefBlockBut(block, object_state_mask_menu, ob, 
"State", (short)(xco-10), (short)(yco-10), 36, UI_UNIT_Y, "Object state menu: 
store and retrieve initial state");
 
                        if (!ob->state)
                                ob->state = 1;
@@ -3116,9 +3116,9 @@
                                }
                        }
                        uiBlockBeginAlign(block);
-                       uiDefButBitS(block, TOG, OB_SETSTBIT, B_SET_STATE_BIT, 
"All",(short)(xco+226), yco-10, 22, 19, &ob->scaflag, 0, 0, 0, 0, "Set all 
state bits");
-                       uiDefButBitS(block, TOG, OB_INITSTBIT, 
B_INIT_STATE_BIT, "Ini",(short)(xco+248), yco-10, 22, 19, &ob->scaflag, 0, 0, 
0, 0, "Set the initial state");
-                       uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, 
"D",(short)(xco+270), yco-10, 15, 19, &ob->scaflag, 0, 0, 0, 0, "Print state 
debug info");
+                       uiDefButBitS(block, TOG, OB_SETSTBIT, B_SET_STATE_BIT, 
"All",(short)(xco+226), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set 
all state bits");
+                       uiDefButBitS(block, TOG, OB_INITSTBIT, 
B_INIT_STATE_BIT, "Ini",(short)(xco+248), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 
0, 0, 0, 0, "Set the initial state");
+                       uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, 
"D",(short)(xco+270), yco-10, 15, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Print 
state debug info");
                        uiBlockEndAlign(block);
 
                        yco-=35;
@@ -3142,17 +3142,17 @@
                                                        if (act)
                                                                act->flag |= 
ACT_VISIBLE;
                                                }
-                                               uiDefIconButBitS(block, TOG, 
CONT_DEL, B_DEL_CONT, ICON_X,      xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, 
"Delete Controller");
-                                               uiDefIconButBitS(block, 
ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 
19, &cont->flag, 0, 0, 0, 0, "Controller settings");
-                                               uiDefIconButBitS(block, TOG, 
CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, 19, 
&cont->flag, 0, 0, 0, 0, "Mark controller for execution before all non-marked 
controllers (good for startup scripts)");
+                                               uiDefIconButBitS(block, TOG, 
CONT_DEL, B_DEL_CONT, ICON_X,      xco, yco, 22, UI_UNIT_Y, &cont->flag, 0, 0, 
0, 0, "Delete Controller");
+                                               uiDefIconButBitS(block, 
ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 
UI_UNIT_Y, &cont->flag, 0, 0, 0, 0, "Controller settings");
+                                               uiDefIconButBitS(block, TOG, 
CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, UI_UNIT_Y, 
&cont->flag, 0, 0, 0, 0, "Mark controller for execution before all non-marked 
controllers (good for startup scripts)");
 
                                                sprintf(name, "%d", 
first_bit(cont->state_mask)+1);
-                                               uiDefBlockBut(block, 
controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22, 19, 
"Set controller state index (from 1 to 30)");
+                                               uiDefBlockBut(block, 
controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22, 
UI_UNIT_Y, "Set controller state index (from 1 to 30)");
                                
                                                if(cont->flag & CONT_SHOW) {
                                                        cont->otype= cont->type;
-                                                       uiDefButS(block, MENU, 
B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, 19, &cont->type, 0, 
0, 0, 0, "Controller type");
-                                                       but= uiDefBut(block, 
TEX, 1, "", (short)(xco+92), yco, (short)(width-158), 19, cont->name, 0, 31, 0, 
0, "Controller name");
+                                                       uiDefButS(block, MENU, 
B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, UI_UNIT_Y, 
&cont->type, 0, 0, 0, 0, "Controller type");
+                                                       but= uiDefBut(block, 
TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, 
31, 0, 0, "Controller name");
                                                        uiButSetFunc(but, 
make_unique_prop_names_cb, cont->name, (void*) 0);
                                
                                                        ycoo= yco;
@@ -3162,17 +3162,17 @@
                                                else {
                                                        cpack(0x999999);
                                                        glRecti(xco+22, yco, 
xco+width-22,yco+19);
-                                                       but= uiDefBut(block, 
LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, 19, cont, 0, 
0, 0, 0, "Controller type");
+                                                       but= uiDefBut(block, 
LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, UI_UNIT_Y, 
cont, 0, 0, 0, 0, "Controller type");
                                                        uiButSetFunc(but, 
sca_move_controller, cont, NULL);
-                                                       but= uiDefBut(block, 
LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), 19, cont, 0, 0, 
0, 0, "Controller name");
+                                                       but= uiDefBut(block, 
LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), UI_UNIT_Y, cont, 
0, 0, 0, 0, "Controller name");
                                                        uiButSetFunc(but, 
sca_move_controller, cont, NULL);
                                                        ycoo= yco;
                                                }
                                
-                                               but= uiDefIconBut(block, LINK, 
0, ICON_LINK,    (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, "");
+                                               but= uiDefIconBut(block, LINK, 
0, ICON_LINK,    (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 
0, "");
                                                uiSetButLink(but, NULL, (void 
***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR);
                                
-                                               uiDefIconBut(block, INLINK, 0, 
ICON_INLINK,(short)(xco-19), ycoo, 19, 19, cont, LINK_CONTROLLER, 0, 0, 0, "");
+                                               uiDefIconBut(block, INLINK, 0, 
ICON_INLINK,(short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, cont, LINK_CONTROLLER, 
0, 0, 0, "");
                                                /* offset is >0 if at least one 
controller was displayed */
                                                offset++;
                                                yco-=20;
@@ -3188,13 +3188,13 @@
        /* ******************************* */
        xco= 10; yco= 170; width= 400;
 
-       uiDefPulldownBut(block, sensor_menu, NULL, "Sensors", xco-10, yco+35, 
70, 19, "");
+       uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco+35, 70, 
UI_UNIT_Y, "");
        
        uiBlockBeginAlign(block);
-       uiDefButBitS(block, TOG, BUTS_SENS_SEL, B_REDR, "Sel", xco+80, yco+35, 
(width-70)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects");
-       uiDefButBitS(block, TOG, BUTS_SENS_ACT, B_REDR, "Act", 
xco+80+(width-70)/4, yco+35, (width-70)/4, 19, &slogic->scaflag, 0, 0, 0, 0, 
"Show active Object");
-       uiDefButBitS(block, TOG, BUTS_SENS_LINK, B_REDR, "Link", 
xco+80+2*(width-70)/4, yco+35, (width-70)/4, 19, &slogic->scaflag, 0, 0, 0, 0, 
"Show linked Objects to Controller");
-       uiDefButBitS(block, TOG, BUTS_SENS_STATE, B_REDR, "State", 
xco+80+3*(width-70)/4, yco+35, (width-70)/4, 19, &slogic->scaflag, 0, 0, 0, 0, 
"Show only sensors connected to active states");
+       uiDefButBitS(block, TOG, BUTS_SENS_SEL, B_REDR, "Sel", xco+80, yco+35, 
(width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show all selected 
Objects");
+       uiDefButBitS(block, TOG, BUTS_SENS_ACT, B_REDR, "Act", 
xco+80+(width-70)/4, yco+35, (width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 
0, 0, "Show active Object");
+       uiDefButBitS(block, TOG, BUTS_SENS_LINK, B_REDR, "Link", 
xco+80+2*(width-70)/4, yco+35, (width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 
0, 0, "Show linked Objects to Controller");
+       uiDefButBitS(block, TOG, BUTS_SENS_STATE, B_REDR, "State", 
xco+80+3*(width-70)/4, yco+35, (width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 
0, 0, "Show only sensors connected to active states");
        uiBlockEndAlign(block);
        
        for(a=0; a<count; a++) {
@@ -3207,9 +3207,9 @@
                /* presume it is only objects for now */
                uiBlockBeginAlign(block);
 //             if(ob->sensors.first) uiSetCurFont(block, UI_HELVB);

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to