Added rename/delete popups to the file and imageselect windows.

Redesigned the userpreference window layout. (not finished yet)

Enhanced the texteditor with; a rightmousemenu, clipboard text
support (for windows !) and the alt-m keystroke generates a 3d
text object. (up to 1000 characters)

(1, 2, 3, 4 and 7 from http://www.tncci.com/blender/feats.html)
This commit is contained in:
Rob Haarsma 2003-04-28 11:17:21 +00:00
parent 71ffa47752
commit 52f6a630ce
16 changed files with 1128 additions and 135 deletions

@ -38,6 +38,9 @@ void make_editText(void);
void load_editText(void);
void remake_editText(void);
void free_editText(void);
void paste_editText(void);
void txt_export_to_object(struct Text *text);
/**
* @attention The argument is discarded. It is there for
* compatibility.

@ -42,5 +42,6 @@ void set_select_flag_oops(void);
void swap_select_all_oops(void);
void transform_oops(int mode);
void clever_numbuts_oops(void);
#endif

@ -55,5 +55,7 @@ void init_imaselspace(struct ScrArea *sa);
void check_imasel_copy(struct SpaceImaSel *simasel);
void free_imasel(struct SpaceImaSel *simasel);
void clever_numbuts_imasel(void);
#endif

@ -57,5 +57,6 @@ void free_filesel_spec(char *dir);
void winqreadfilespace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
void main_to_filelist(struct SpaceFile *sfile);
void clever_numbuts_filesel(void);
#endif

@ -185,6 +185,10 @@
/* EVENT < 50: alone's en locals */
#define B_KEEPDATA 60
#define B_CONSOLETOG 61
#define B_DRAWINFO 62
#define B_REDRCURW3D 63
#define B_SHOWSPLASH 70
#define B_RESETAUTOSAVE 71
@ -270,6 +274,26 @@
#define B_FILEMENU 306
#define B_PACKFILE 307
#define B_CONSOLEOUT 308
#define B_CONSOLENUMLINES 309
#define B_USERPREF 310
#define B_LOADUIFONT 311
#define B_SETLANGUAGE 312
#define B_SETFONTSIZE 313
#define B_SETENCODING 314
#define B_SETTRANSBUTS 315
/* Definitions for the fileselect buttons in user prefs */
#define B_FONTDIRFILESEL 320
#define B_TEXTUDIRFILESEL 321
#define B_PLUGTEXDIRFILESEL 322
#define B_PLUGSEQDIRFILESEL 323
#define B_RENDERDIRFILESEL 324
#define B_PYTHONDIRFILESEL 325
#define B_SOUNDDIRFILESEL 326
#define B_TEMPDIRFILESEL 327
/* END Definitions for the fileselect buttons in user prefs */
/* IMAGE: 350 */
#define B_SIMAGEHOME 351
#define B_SIMABROWSE 352

@ -85,6 +85,7 @@ extern UserDef U; /* from usiblender.c !!!! */
#define KEYINSERTOBJ 2
#define WHEELZOOMDIR 4
#define FILTERFILEEXTS 8
#define DRAWVIEWINFO 16
/* transopts */

@ -81,7 +81,9 @@
#include "BSE_drawview.h"
#include "BSE_sequence.h"
#ifdef WITH_QUICKTIME
#include "quicktime_export.h"
#endif
/* this module */
#include "render.h"

@ -68,6 +68,7 @@
#include "BIF_keyval.h"
#include "BIF_interface.h"
#include "BIF_drawtext.h"
#include "BIF_editfont.h"
#include "BIF_spacetypes.h"
#include "BIF_usiblender.h"
#include "BIF_screen.h"
@ -742,6 +743,135 @@ static int jumptoline_interactive(SpaceText *st) {
}
}
int bufferlength;
static char *copybuffer = NULL;
void txt_copy_selectbuffer (Text *text)
{
int length=0;
TextLine *tmp, *linef, *linel;
int charf, charl;
if (!text) return;
if (!text->curl) return;
if (!text->sell) return;
if (!txt_has_sel(text)) return;
if (copybuffer) {
MEM_freeN(copybuffer);
copybuffer= NULL;
}
if (text->curl==text->sell) {
linef= linel= text->curl;
if (text->curc < text->selc) {
charf= text->curc;
charl= text->selc;
} else{
charf= text->selc;
charl= text->curc;
}
} else if (txt_get_span(text->curl, text->sell)<0) {
linef= text->sell;
linel= text->curl;
charf= text->selc;
charl= text->curc;
} else {
linef= text->curl;
linel= text->sell;
charf= text->curc;
charl= text->selc;
}
if (linef == linel) {
length= charl-charf;
copybuffer= MEM_mallocN(length+1, "cut buffera");
BLI_strncpy(copybuffer, linef->line + charf, length+1);
} else {
length+= linef->len - charf;
length+= charl;
length++; /* For the '\n' */
tmp= linef->next;
while (tmp && tmp!= linel) {
length+= tmp->len+1;
tmp= tmp->next;
}
copybuffer= MEM_mallocN(length+1, "cut bufferb");
strncpy(copybuffer, linef->line+ charf, linef->len-charf);
length= linef->len-charf;
copybuffer[length++]='\n';
tmp= linef->next;
while (tmp && tmp!=linel) {
strncpy(copybuffer+length, tmp->line, tmp->len);
length+= tmp->len;
copybuffer[length++]='\n';
tmp= tmp->next;
}
strncpy(copybuffer+length, linel->line, charl);
length+= charl;
copybuffer[length]=0;
}
bufferlength = length;
}
void txt_paste_clipboard(Text *text) {
#ifdef _WIN32
char * buffer = NULL;
if ( OpenClipboard(NULL) ) {
HANDLE hData = GetClipboardData( CF_TEXT );
buffer = (char*)GlobalLock( hData );
txt_insert_buf(text, buffer);
GlobalUnlock( hData );
CloseClipboard();
}
#endif
}
void txt_copy_clipboard(Text *text) {
#ifdef _WIN32
txt_copy_selectbuffer(text);
if (OpenClipboard(NULL)) {
HLOCAL clipbuffer;
char* buffer;
EmptyClipboard();
clipbuffer = LocalAlloc(LMEM_FIXED,((bufferlength+1)));
buffer = (char *) LocalLock(clipbuffer);
strncpy(buffer, copybuffer, bufferlength);
buffer[bufferlength] = '\0';
LocalUnlock(clipbuffer);
SetClipboardData(CF_TEXT,clipbuffer);
CloseClipboard();
}
if (copybuffer) {
MEM_freeN(copybuffer);
copybuffer= NULL;
}
#endif
}
void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
{
unsigned short event= evt->event;
@ -760,8 +890,7 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
text= st->text;
if (!text) {
if (val && !ELEM(G.qual, 0, LR_SHIFTKEY)) {
if (event==FKEY && (G.qual & LR_ALTKEY) && (G.qual & LR_SHIFTKEY)) {
if (event==RIGHTMOUSE) {
switch (pupmenu("File %t|New %x0|Open... %x1")) {
case 0:
st->text= add_empty_text();
@ -774,7 +903,22 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
activate_fileselect(FILE_SPECIAL, "LOAD TEXT FILE", G.sce, add_text_fs);
break;
}
} else if (event==QKEY) {
}
if (val && !ELEM(G.qual, 0, LR_SHIFTKEY)) {
if (event==FKEY && (G.qual & LR_ALTKEY) && (G.qual & LR_SHIFTKEY)) {
switch (pupmenu("File %t|New %x0|Open... %x1")) {
case 0:
st->text= add_empty_text();
st->top= 0;
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
break;
case 1:
activate_fileselect(FILE_SPECIAL, "LOAD TEXT FILE", G.sce, add_text_fs);
break;
}
} else if (event==QKEY) {
if(okee("QUIT BLENDER")) exit_usiblender();
}
}
@ -799,6 +943,35 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if (val) {
do_textscroll(st, 1);
}
} else if (event==RIGHTMOUSE) {
if (val) {
p= pupmenu("File %t|New %x0|Open... %x1|Save %x2|Save As...%x3");
switch(p) {
case 0:
st->text= add_empty_text();
st->top= 0;
allqueue(REDRAWTEXT, 0);
allqueue(REDRAWHEADERS, 0);
break;
case 1:
activate_fileselect(FILE_SPECIAL, "LOAD TEXT FILE", G.sce, add_text_fs);
break;
case 3:
text->flags |= TXT_ISMEM;
case 2:
txt_write_file(text);
do_draw= 1;
break;
default:
break;
}
}
} else if (ascii) {
if (txt_add_char(text, ascii)) {
pop_space_text(st);
@ -962,11 +1135,11 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
switch(event) {
case AKEY:
if (G.qual & LR_CTRLKEY) {
if (G.qual & LR_ALTKEY) {
txt_move_bol(text, G.qual & LR_SHIFTKEY);
do_draw= 1;
pop_space_text(st);
} else if (G.qual & LR_ALTKEY) {
} else if (G.qual & LR_CTRLKEY) {
txt_sel_all(text);
do_draw= 1;
}
@ -974,7 +1147,11 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case CKEY:
if (G.qual & LR_ALTKEY || G.qual & LR_CTRLKEY) {
txt_copy_sel(text);
if(G.qual & LR_SHIFTKEY)
txt_copy_clipboard(text);
else
txt_copy_sel(text);
do_draw= 1;
}
break;
@ -1007,6 +1184,13 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
break;
case MKEY:
if (G.qual & LR_ALTKEY) {
txt_export_to_object(text);
do_draw= 1;
}
break;
case PKEY:
if (G.qual & LR_ALTKEY) {
if (!BPY_txt_do_python(st)) {
@ -1058,7 +1242,8 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case UKEY:
if (G.qual & LR_ALTKEY) {
if (G.qual & LR_SHIFTKEY) txt_print_undo(text);
if (G.qual & LR_SHIFTKEY) txt_do_redo(text);
//txt_print_undo(text); //debug buffer in console
else {
txt_do_undo(text);
do_draw= 1;
@ -1068,7 +1253,11 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case VKEY:
if (G.qual & LR_ALTKEY || G.qual & LR_CTRLKEY) {
txt_paste(text);
if(G.qual & LR_SHIFTKEY)
txt_paste_clipboard(text);
else
txt_paste(text);
do_draw= 1;
pop_space_text(st);
}

@ -765,6 +765,19 @@ void drawname(Object *ob)
BMF_DrawString(G.font, ob->id.name+2);
}
static void draw_selected_name(char *name)
{
char info[128];
sprintf(info, "(%d) %s", CFRA, name);
cpack(0xFFFFFF);
glRasterPos2i(30, 10);
BMF_DrawString(G.fonts, info);
}
static void draw_view_icon(void)
{
BIFIconID icon;
@ -975,6 +988,9 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
if(G.vd->persp>1) drawviewborder();
drawcursor();
draw_view_icon();
ob= OBACT;
if(ob!=0 && (U.uiflag & DRAWVIEWINFO)) draw_selected_name(ob->id.name+2);
persp(1);

@ -52,12 +52,14 @@
#include "DNA_object_types.h"
#include "DNA_vfont_types.h"
#include "DNA_scene_types.h"
#include "DNA_text_types.h"
#include "BKE_displist.h"
#include "BKE_font.h"
#include "BKE_object.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_utildefines.h"
#include "BIF_editfont.h"
#include "BIF_toolbox.h"
@ -205,6 +207,7 @@ static char findaccent(char char1, char code)
else return char1;
}
static char *textbuf=0;
static char *oldstr;
@ -226,6 +229,89 @@ static int insert_into_textbuf(Curve *cu, char c)
}
}
static VFont *get_builtin_font(void)
{
VFont *vf;
for (vf= G.main->vfont.first; vf; vf= vf->id.next)
if (BLI_streq(vf->name, "<builtin>"))
return vf;
return load_vfont("<builtin>");
}
void txt_export_to_object(struct Text *text)
{
ID *id;
Curve *cu;
struct TextLine *tmp;
int nchars = 0;
// char sdir[FILE_MAXDIR];
// char sfile[FILE_MAXFILE];
if(!text) return;
id = (ID *)text;
if (G.obedit && G.obedit->type==OB_FONT) return;
check_editmode(OB_FONT);
add_object(OB_FONT);
base_init_from_view3d(BASACT, G.vd);
G.obedit= BASACT->object;
where_is_object(G.obedit);
cu= G.obedit->data;
/*
// renames object, careful with long filenames.
if (text->name) {
//ID *find_id(char *type, char *name)
BLI_split_dirfile(text->name, sdir, sfile);
// rename_id((ID *)G.obedit, sfile);
rename_id((ID *)cu, sfile);
id->us++;
}
*/
cu->vfont= get_builtin_font();
cu->vfont->id.us++;
tmp= text->lines.first;
while(cu->len<MAXTEXT && tmp) {
nchars += strlen(tmp->line) + 1;
tmp = tmp->next;
}
if(cu->str) MEM_freeN(cu->str);
cu->str= MEM_mallocN(nchars+1, "str");
tmp= text->lines.first;
strcpy(cu->str, tmp->line);
cu->len= strlen(tmp->line);
cu->pos= cu->len;
tmp= tmp->next;
while(cu->len<MAXTEXT && tmp) {
strcat(cu->str, "\n");
strcat(cu->str, tmp->line);
cu->len+= strlen(tmp->line) + 1;
cu->pos= cu->len;
tmp= tmp->next;
}
make_editText();
exit_editmode(1);
allqueue(REDRAWVIEW3D, 0);
}
void do_textedit(unsigned short event, short val, char _ascii)
{
Curve *cu;
@ -399,6 +485,59 @@ void do_textedit(unsigned short event, short val, char _ascii)
}
}
void paste_editText(void)
{
Curve *cu;
int file, filelen, doit= 0;
char *strp;
#ifdef WIN32
file= open("C:\\windows\\temp\\cutbuf.txt", O_BINARY|O_RDONLY);
// The following is more likely to work on all Win32 installations.
// suggested by Douglas Toltzman. Needs windows include files...
/*
char tempFileName[MAX_PATH];
DWORD pathlen;
static const char cutbufname[]="cutbuf.txt";
if ((pathlen=GetTempPath(sizeof(tempFileName),tempFileName)) > 0 &&
pathlen + sizeof(cutbufname) <= sizeof(tempFileName))
{
strcat(tempFileName,cutbufname);
file= open(tempFileName, O_BINARY|O_RDONLY);
}
*/
#else
file= open("/tmp/.cutbuffer", O_BINARY|O_RDONLY);
#endif
if(file>0) {
cu= G.obedit->data;
filelen = BLI_filesize(file);
strp= MEM_mallocN(filelen+1, "tempstr");
read(file, strp, filelen);
close(file);
strp[filelen]= 0;
if(cu->len+filelen<MAXTEXT) {
strcat( textbuf, strp);
cu->len= strlen(textbuf);
cu->pos= cu->len;
}
MEM_freeN(strp);
doit = 1;
}
if(doit) {
text_to_curve(G.obedit, 0);
makeDispList(G.obedit);
allqueue(REDRAWVIEW3D, 0);
}
}
void make_editText(void)
{
Curve *cu;
@ -418,6 +557,7 @@ void make_editText(void)
textediting= 1;
}
void load_editText(void)
{
Curve *cu;
@ -438,6 +578,7 @@ void load_editText(void)
textediting= 0;
}
void remake_editText(void)
{
Curve *cu;
@ -455,6 +596,7 @@ void remake_editText(void)
allqueue(REDRAWVIEW3D, 0);
}
void free_editText(void)
{
if(oldstr) MEM_freeN(oldstr);
@ -462,16 +604,6 @@ void free_editText(void)
textediting= 0;
}
static VFont *get_builtin_font(void)
{
VFont *vf;
for (vf= G.main->vfont.first; vf; vf= vf->id.next)
if (BLI_streq(vf->name, "<builtin>"))
return vf;
return load_vfont("<builtin>");
}
void add_primitiveFont(int dummy_argument)
{

@ -62,6 +62,7 @@
#include "BIF_interface.h"
#include "BIF_imasel.h"
#include "BIF_mywindow.h"
#include "BIF_toolbox.h"
#include "BSE_filesel.h"
#include "BSE_drawimasel.h"
@ -94,6 +95,7 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
short mval[2];
short area_event;
short queredraw = 0;
int ret = 0;
char name[256];
char *selname;
static double prevtime=0;
@ -335,6 +337,15 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
break;
case IKEY:
if ((G.qual == 0)&&(simasel->file)){
sprintf(name, "$IMAGEEDITOR %s%s", simasel->dir, simasel->file);
system(name);
queredraw = 1;
}
break;
case PKEY:
if(G.qual & LR_SHIFTKEY) {
extern char bprogname[]; /* usiblender.c */
@ -353,15 +364,24 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
break;
case IKEY:
if ((G.qual == 0)&&(simasel->file)){
sprintf(name, "$IMAGEEDITOR %s%s", simasel->dir, simasel->file);
system(name);
queredraw = 1;
}
case RKEY:
case XKEY:
if (simasel->hilite_ima){
strcpy(name, simasel->dir);
strcat(name, simasel->hilite_ima->file_name);
if( okee("Remove %s", name) ) {
ret = BLI_delete(name, 0, 0);
if (ret) {
error("Command failed, see console");
} else {
clear_ima_dir(simasel);
queredraw = 1;
}
}
}
break;
case PADPLUSKEY:
case EQUALKEY:
BLI_newname(simasel->file, +1);
@ -411,3 +431,32 @@ void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
void clever_numbuts_imasel()
{
SpaceImaSel *simasel;
static char orgname[FILE_MAXDIR+FILE_MAXFILE+12];
static char filename[FILE_MAXDIR+FILE_MAXFILE+12];
static char newname[FILE_MAXDIR+FILE_MAXFILE+12];
int len;
simasel= curarea->spacedata.first;
len = 110;
if (simasel->hilite_ima){
BLI_make_file_string(G.sce, orgname, simasel->dir, simasel->hilite_ima->file_name);
strcpy(filename, simasel->hilite_ima->file_name);
add_numbut(0, TEX, "", 0, len, filename, "Rename Image");
if( do_clever_numbuts("Rename Image", 1, REDRAW) ) {
BLI_make_file_string(G.sce, newname, simasel->dir, filename);
if( strcmp(orgname, newname) != 0 ) {
BLI_rename(orgname, newname);
clear_ima_dir(simasel);
}
}
scrarea_queue_winredraw(curarea);
}
}

@ -59,6 +59,7 @@
#include "BKE_global.h"
#include "BKE_scene.h"
#include "BKE_library.h"
#include "BKE_material.h"
#include "BIF_space.h"
@ -67,6 +68,7 @@
#include "BIF_editview.h"
#include "BIF_drawscene.h"
#include "BIF_mywindow.h"
#include "BIF_toolbox.h"
#include "BDR_editobject.h"
@ -75,6 +77,7 @@
#include "blendef.h"
#include "mydevice.h"
#include "interface.h"
typedef struct TransOops {
@ -82,6 +85,8 @@ typedef struct TransOops {
float oldloc[2];
} TransOops;
struct ID *idt;
static void oops_to_select_objects(void)
{
@ -598,3 +603,46 @@ void select_backlinked_oops(void)
oops_to_select_objects(); /* ook redr */
}
void clever_numbuts_oops()
{
Oops *oops;
Object *ob;
ID *id = idt;
char str1[10];
static char naam[256];
static char naam2[256];
static short doit;
int len;
if(G.soops->lockpoin) {
oops= G.soops->lockpoin;
ob = (Object *)oops->id;
if(oops->type==ID_LI) strcpy(naam, ((Library *)oops->id)->name);
else strcpy(naam, oops->id->name);
strcpy(naam2, naam+2);
str1[0]= oops->id->name[0];
str1[1]= oops->id->name[1];
str1[2]= ':';
str1[3]= 0;
if(strcmp(str1, "SC:")==0) strcpy(str1, "SCE:");
else if(strcmp(str1, "SR:")==0) strcpy(str1, "SCR:");
// if( GS(id->name)==ID_IP) len= 110;
// else len= 120;
len = 110;
add_numbut(0, TEX, str1, 0, len, naam2, "Rename Object");
if((oops->type==ID_OB || oops->type==ID_ME) && ob->type != OB_EMPTY) {
// add_numbut(1, TEX, str1, 0, len, naam2, "Name Object");
add_numbut(1, TOG|SHO, "Rename Linked Data", 0, 0, &doit, "Rename corresponding Datablock as well");
do_clever_numbuts("Rename Datablock", 2, REDRAW);
} else {
do_clever_numbuts("Rename Datablock", 1, REDRAW);
}
rename_id((ID *)oops->id, naam2);
}
}

@ -1783,6 +1783,20 @@ static void fs_fake_users(SpaceFile *sfile)
scrarea_queue_winredraw(curarea);
}
static int get_hilited_entry(SpaceFile *sfile)
{
int a, count=0;
for(a=0; a<sfile->totfile; a++) {
if(sfile->filelist[a].flags & HILITE) {
return a;
}
}
return -1;
}
void winqreadfilespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
{
unsigned short event= evt->event;
@ -1992,6 +2006,25 @@ void winqreadfilespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
reread_other_fs();
break;
case XKEY:
test = get_hilited_entry(sfile);
if (test != -1 && !(S_ISDIR(sfile->filelist[test].type))){
BLI_make_file_string(G.sce, str, sfile->dir, sfile->filelist[test].relname);
if( okee("Remove %s", str) ) {
ret = BLI_delete(str, 0, 0);
if (ret) {
error("Command failed, see console");
} else {
freefilelist(sfile);
do_draw= 1;
}
}
}
break;
case RKEY:
if(sfile->type==FILE_MAIN) {
databrowse_replace(sfile, groupname_to_code(sfile->dir));
@ -2501,4 +2534,38 @@ void main_to_filelist(SpaceFile *sfile)
}
void clever_numbuts_filesel()
{
SpaceFile *sfile;
char orgname[FILE_MAXDIR+FILE_MAXFILE+12];
char filename[FILE_MAXDIR+FILE_MAXFILE+12];
char newname[FILE_MAXDIR+FILE_MAXFILE+12];
int test;
int len;
sfile= curarea->spacedata.first;
if(sfile->type==FILE_MAIN) return;
len = 110;
test = get_hilited_entry(sfile);
if (test != -1 && !(S_ISDIR(sfile->filelist[test].type))){
BLI_make_file_string(G.sce, orgname, sfile->dir, sfile->filelist[test].relname);
strcpy(filename, sfile->filelist[test].relname);
add_numbut(0, TEX, "", 0, len, filename, "Rename File");
if( do_clever_numbuts("Rename File", 1, REDRAW) ) {
BLI_make_file_string(G.sce, newname, sfile->dir, filename);
if( strcmp(orgname, newname) != 0 ) {
BLI_rename(orgname, newname);
freefilelist(sfile);
}
}
scrarea_queue_winredraw(curarea);
}
}

@ -537,6 +537,84 @@ static void show_splash(void)
splash((void *)datatoc_splash_jpg, datatoc_splash_jpg_size, string);
}
/* Functions for user preferences fileselect windows */
void filesel_u_fontdir(char *name)
{
char dir[FILE_MAXDIR], file[FILE_MAXFILE];
BLI_split_dirfile(name, dir, file);
strcpy(U.fontdir, dir);
allqueue(REDRAWALL, 0);
}
void filesel_u_textudir(char *name)
{
char dir[FILE_MAXDIR], file[FILE_MAXFILE];
BLI_split_dirfile(name, dir, file);
strcpy(U.textudir, dir);
allqueue(REDRAWALL, 0);
}
void filesel_u_plugtexdir(char *name)
{
char dir[FILE_MAXDIR], file[FILE_MAXFILE];
BLI_split_dirfile(name, dir, file);
strcpy(U.plugtexdir, dir);
allqueue(REDRAWALL, 0);
}
void filesel_u_plugseqdir(char *name)
{
char dir[FILE_MAXDIR], file[FILE_MAXFILE];
BLI_split_dirfile(name, dir, file);
strcpy(U.plugseqdir, dir);
allqueue(REDRAWALL, 0);
}
void filesel_u_renderdir(char *name)
{
char dir[FILE_MAXDIR], file[FILE_MAXFILE];
BLI_split_dirfile(name, dir, file);
strcpy(U.renderdir, dir);
allqueue(REDRAWALL, 0);
}
void filesel_u_pythondir(char *name)
{
char dir[FILE_MAXDIR], file[FILE_MAXFILE];
BLI_split_dirfile(name, dir, file);
strcpy(U.pythondir, dir);
allqueue(REDRAWALL, 0);
}
void filesel_u_sounddir(char *name)
{
char dir[FILE_MAXDIR], file[FILE_MAXFILE];
BLI_split_dirfile(name, dir, file);
strcpy(U.sounddir, dir);
allqueue(REDRAWALL, 0);
}
void filesel_u_tempdir(char *name)
{
char dir[FILE_MAXDIR], file[FILE_MAXFILE];
BLI_split_dirfile(name, dir, file);
strcpy(U.tempdir, dir);
allqueue(REDRAWALL, 0);
}
/* END Functions for user preferences fileselect windows */
void do_global_buttons(unsigned short event)
{
ListBase *lb;
@ -549,7 +627,9 @@ void do_global_buttons(unsigned short event)
Sequence *seq;
bAction *act;
ID *id, *idtest, *from;
ScrArea *sa;
int nr= 1;
char buf[FILE_MAXDIR+FILE_MAXFILE];
ob= OBACT;
@ -1309,6 +1389,122 @@ void do_global_buttons(unsigned short event)
case B_LOADTEMP: /* is button uit space.c */
BIF_read_autosavefile();
break;
case B_USERPREF:
allqueue(REDRAWINFO, 0);
// BIF_printf("userpref %d\n", U.userpref);
break;
case B_DRAWINFO: /* is button uit space.c *info* */
allqueue(REDRAWVIEW3D, 0);
break;
/* Fileselect windows for user preferences file paths */
case B_FONTDIRFILESEL: /* is button uit space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
}
activate_fileselect(FILE_SPECIAL, "SELECT FONT PATH", U.fontdir, filesel_u_fontdir);
break;
case B_TEXTUDIRFILESEL: /* is button uit space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
}
activate_fileselect(FILE_SPECIAL, "SELECT TEXTURE PATH", U.textudir, filesel_u_textudir);
break;
case B_PLUGTEXDIRFILESEL: /* is button uit space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
}
activate_fileselect(FILE_SPECIAL, "SELECT TEX PLUGIN PATH", U.plugtexdir, filesel_u_plugtexdir);
break;
case B_PLUGSEQDIRFILESEL: /* is button uit space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
}
activate_fileselect(FILE_SPECIAL, "SELECT SEQ PLUGIN PATH", U.plugseqdir, filesel_u_plugseqdir);
break;
case B_RENDERDIRFILESEL: /* is button uit space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
}
activate_fileselect(FILE_SPECIAL, "SELECT RENDER PATH", U.renderdir, filesel_u_renderdir);
break;
case B_PYTHONDIRFILESEL: /* is button uit space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
}
activate_fileselect(FILE_SPECIAL, "SELECT SCRIPT PATH", U.pythondir, filesel_u_pythondir);
break;
case B_SOUNDDIRFILESEL: /* is button uit space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
}
activate_fileselect(FILE_SPECIAL, "SELECT SOUND PATH", U.sounddir, filesel_u_sounddir);
break;
case B_TEMPDIRFILESEL: /* is button uit space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
}
activate_fileselect(FILE_SPECIAL, "SELECT TEMP FILE PATH", U.tempdir, filesel_u_tempdir);
break;
/* END Fileselect windows for user preferences file paths */
#ifdef INTERNATIONAL
case B_LOADUIFONT: /* is button uit space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();
areawinset(sa->win);
}
BLI_make_file_string("/", buf, U.fontdir, U.fontname);
activate_fileselect(FILE_SPECIAL, "LOAD UI FONT", buf, set_interface_font);
break;
case B_SETLANGUAGE: /* is button uit space.c *info* */
lang_setlanguage();
allqueue(REDRAWALL, 0);
break;
case B_SETFONTSIZE: /* is button uit space.c *info* */
FTF_SetSize(U.fontsize);
allqueue(REDRAWALL, 0);
break;
case B_SETTRANSBUTS: /* is button uit space.c *info* */
allqueue(REDRAWALL, 0);
break;
case B_SETENCODING: /* is button uit space.c *info* */
lang_setencoding();
allqueue(REDRAWALL, 0);
break;
#endif
case B_FULL:
if(curarea->spacetype!=SPACE_INFO) {
area_fullscreen();

@ -460,6 +460,14 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
do_textedit(event, val, ascii);
}
break;
case VKEY:
if(G.qual & LR_ALTKEY) {
paste_editText();
doredraw= 1;
} else {
do_textedit(event, val, ascii);
}
break;
case PAD0: case PAD1: case PAD2: case PAD3: case PAD4:
case PAD5: case PAD6: case PAD7: case PAD8: case PAD9:
case PADENTER:
@ -1265,7 +1273,9 @@ void drawinfospace(ScrArea *sa, void *spacedata)
{
uiBlock *block;
float fac;
int dx;
short xpos, ypos, buth, rspace, dx, y1, y2, y3;
short smallprefbut, medprefbut, largeprefbut, smfileselbut;
short edgespace, midspace;
char naam[32];
if(curarea->win==0) return;
@ -1278,123 +1288,362 @@ void drawinfospace(ScrArea *sa, void *spacedata)
sprintf(naam, "infowin %d", curarea->win);
block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->win);
// uiBlockSetEmboss(block, UI_EMBOSSM);
uiBlockSetCol(block, BUTBLUE);
uiDefButS(block, TOG|BIT|0, B_RESETAUTOSAVE, "Auto Temp Save", 45,32,126,20, &(U.flag), 0, 0, 0, 0, "Enables/Disables the automatic temp. file saving");
uiBlockSetCol(block, BUTGREY);
uiDefBut(block, TEX, 0, "Dir:", 45,10,127,20, U.tempdir, 1.0, 63.0, 0, 0, "The directory for temp. files");
uiDefButI(block, NUM, B_RESETAUTOSAVE, "Time:", 174,32,91,20, &(U.savetime), 1.0, 60.0, 0, 0, "The time in minutes to wait between temp. saves");
uiBlockSetCol(block, BUTSALMON);
uiDefBut(block, BUT, B_LOADTEMP, "Load Temp", 174,10,90,20, 0, 0, 0, 0, 0, "Loads the most recently saved temp file");
uiBlockSetCol(block, BUTGREY);
uiDefButS(block, NUM, 0, "Versions:", 281,10,86,42, &U.versions, 0.0, 32.0, 0, 0, "The number of old versions to maintain when saving");
// uiDefBut(block, LABEL,0,"Blender Settings", 1100,90,133,18, 0, 0, 0, 0, 0, "");
uiBlockSetCol(block, BUTYELLOW);
uiDefButI(block, TOG|BIT|USERDEF_VERTEX_ARRAYS_BIT, 0, "Vertex arrays",
389,54,86,20, &(U.gameflags), 0, 0, 0, 0,
"Toggle between vertex arrays on (less reliable) and off (more reliable)");
uiDefButI(block, TOG|BIT|USERDEF_DISABLE_SOUND_BIT, B_SOUNDTOGGLE, "No sound",
478,54,86,20, &(U.gameflags), 0, 0, 0, 0,
"Toggle between sound on and sound off");
uiDefButI(block, TOG|BIT|USERDEF_DISABLE_MIPMAP_BIT, B_MIPMAPCHANGED, "No Mipmaps",
569,54,78,20, &(U.gameflags), 0, 0, 0, 0,
"Toggle between Mipmap textures on (beautiful) and off (fast)");
uiBlockSetCol(block, BUTGREEN);
uiDefButS(block, TOG|BIT|4, 0, "Scene Global",
389,32,86,20, &(U.flag), 0, 0, 0, 0,
"Forces the current Scene to be displayed in all Screens");
uiDefButS(block, TOG|BIT|5, 0, "TrackBall",
389,10,86,20, &(U.flag), 0, 0, 0, 0,
"Switches between trackball and turntable view rotation methods (MiddleMouse)");
uiDefButS(block, TOG|BIT|12, 0, "2-Mouse",
478,10,86,20, &(U.flag), 0, 0, 0, 0,
"Maps ALT+LeftMouse to MiddleMouse button");
uiDefButS(block, TOG|BIT|8, 0, "Mat on Obj",
569,9,78,20, &(U.flag), 0, 0, 0, 0,
"Sets whether Material data is linked to Obj or ObjData");
uiDefButS(block, TOG|BIT|9, B_U_CAPSLOCK, "NoCapsLock",
478,32,86,20, &(U.flag), 0, 0, 0, 0,
"Deactives the CapsLock button (only applies to text input)");
uiDefButS(block, TOG|BIT|10, 0, "Viewmove",
569,32,78,20, &(U.flag), 0, 0, 0, 0,
"Sets the default action for the middle mouse button");
uiDefButS(block, TOG|BIT|13, 0, "noNumpad",
653,10,76,20, &(U.flag), 0, 0, 0, 0,
"For laptops: keys 1 to 0 become numpad keys");
uiDefButS(block, TOG|BIT|11, 0, "ToolTips",
653,32,76,20, &(U.flag), 0, 0, 0, 0,
"Enables/Disables tooltips");
// uiDefButS(block, ICONTOG|BIT|14, 0, ICON(), 733,10,50,42, &(U.flag), 0, 0, 0, 0, "Automatic keyframe insertion");
uiDefButS(block, TOG|BIT|0, 0, "KeyAC", 733,32,50,20, &(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion for actions");
uiDefButS(block, TOG|BIT|1, 0, "KeyOB", 733,10,50,20, &(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion for objects");
uiDefButS(block, TOG|BIT|1, 0, "Grab Grid", 788,32,106,20, &(U.flag), 0, 0, 0, 0, "Changes default step mode for grabbing");
uiDefButS(block, TOG|BIT|2, 0, "Rot", 842,10,52,20, &(U.flag), 0, 0, 0, 0, "Changes default step mode for rotation");
uiDefButS(block, TOG|BIT|3, 0, "Size", 788,10,52,20, &(U.flag), 0, 0, 0, 0, "Changes default step mode for scaling");
uiDefButS(block, TOG|BIT|0, 0, "Dupli Mesh", 902,32,90,20, &(U.dupflag), 0, 0, 0, 0, "Causes Mesh data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|9, 0, "Armature", 902,10,90,20, &(U.dupflag), 0, 0, 0, 0, "Causes Armature data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|1, 0, "Curve", 995,32,50,20, &(U.dupflag), 0, 0, 0, 0, "Causes Curve data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|2, 0, "Surf", 995,10,50,20, &(U.dupflag), 0, 0, 0, 0, "Causes Surface data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|3, 0, "Text", 1048,32,50,20, &(U.dupflag), 0, 0, 0, 0, "Causes Text data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|4, 0, "MBall", 1048,10,50,20, &(U.dupflag), 0, 0, 0, 0, "Causes Metaball data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|5, 0, "Lamp", 1101,32,50,20, &(U.dupflag), 0, 0, 0, 0, "Causes Lamp data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|6, 0, "Ipo", 1101,10,50,20, &(U.dupflag), 0, 0, 0, 0, "Causes Ipo data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|7, 0, "Material", 1153,32,70,20, &(U.dupflag), 0, 0, 0, 0, "Causes Material data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|8, 0, "Texture", 1153,10,70,20, &(U.dupflag), 0, 0, 0, 0, "Causes Texture data to be duplicated with Shift+D");
uiBlockSetCol(block, BUTGREY);
uiDefButI(block, NUM, 0, "WLines",
1153,54,70,20, &U.wheellinescroll,
1.0, 32.0, 0, 0,
"Mousewheel: The number of lines that get scrolled");
uiDefButS(block, TOG|BIT|2, 0, "WZoom",
1081,54,70,20, &(U.uiflag), 0, 0, 0, 0,
"Mousewheel: Swaps mousewheel zoom direction");
xpos = 45;
ypos = 12;
buth = 20;
rspace = 2;
dx= (1280-90)/6;
uiBlockSetCol(block, BUTBLUE);
uiDefButI(block, ROW,B_USERPREF,"View & Controls",
xpos,ypos,(short)dx,buth,
&U.userpref,1.0,0.0, 0, 0,"");
uiDefButI(block, ROW,B_USERPREF,"Auto Save",
(short)(xpos+2*dx),ypos,(short)dx,buth,
&U.userpref,1.0,1.0, 0, 0,"");
uiDefButI(block, ROW,B_USERPREF,"Edit Methods",
(short)(xpos+dx),ypos,(short)dx,buth,
&U.userpref,1.0,2.0, 0, 0,"");
uiDefButI(block, ROW,B_USERPREF,"File Paths",
(short)(xpos+3*dx),ypos,(short)dx,buth,
&U.userpref,1.0,4.0, 0, 0,"");
uiDefButI(block, ROW,B_USERPREF,"Language & Colors",
(short)(xpos+4*dx),ypos,(short)dx,buth,
&U.userpref,1.0,5.0, 0, 0,"");
uiDefButI(block, ROW,B_USERPREF,"System & OpenGL",
(short)(xpos+5*dx),ypos,(short)dx,buth,
&U.userpref,1.0,3.0, 0, 0,"");
uiBlockSetEmboss(block, UI_EMBOSSX);
uiBlockSetCol(block, BUTGREY);
xpos = 45;
ypos = 58;
buth = 20;
rspace = 4;
smallprefbut = 94;
medprefbut = 193;
largeprefbut = 292;
smfileselbut = buth;
edgespace = 3;
midspace = 5;
#define _XPOS_ 45
#define _YPOS_ 80
#define _BUTH_ 20
#define _RULESPACE_ 2
uiDefBut(block, TEX, 0, "Python:",
_XPOS_,_YPOS_-_BUTH_-_RULESPACE_,(short)dx,_BUTH_, U.pythondir, 1.0, 63.0, 0, 0,
"The default directory for Python scripts");
uiDefBut(block, TEX, 0, "Fonts:",
_XPOS_,_YPOS_,(short)dx,_BUTH_, U.fontdir, 1.0, 63.0, 0, 0,
"The default directory to search when loading fonts");
uiDefBut(block, TEX, 0, "Render:",
(short)(_XPOS_+dx),_YPOS_,(short)dx,_BUTH_, U.renderdir, 1.0, 63.0, 0, 0,
"The default directory to choose for rendering");
uiDefBut(block, TEX, 0, "Textures:",
(short)(_XPOS_+2*dx),_YPOS_,(short)dx,_BUTH_, U.textudir, 1.0, 63.0, 0, 0,
"The default directory to search when loading textures");
uiDefBut(block, TEX, 0, "TexPlugin:",
(short)(_XPOS_+3*dx),_YPOS_,(short)dx,_BUTH_, U.plugtexdir, 1.0, 63.0, 0, 0,
"The default directory to search when loading texture plugins");
uiDefBut(block, TEX, 0, "SeqPlugin:",
(short)(_XPOS_+4*dx),_YPOS_,(short)dx,_BUTH_, U.plugseqdir, 1.0, 63.0, 0, 0,
"The default directory to search when loading sequence plugins");
uiDefBut(block, TEX, 0, "Sounds:",
(short)(_XPOS_+5*dx),_YPOS_,(short)dx,_BUTH_, U.sounddir, 1.0, 63.0, 0, 0,
"The default directory to search when loading sounds");
#undef _XPOS_
#undef _YPOS_
#undef _BUTH_
#undef _RULESPACE_
y1 = ypos;
y2 = ypos+buth+rspace;
y3 = ypos+2*(buth+rspace);
/* line 2: left x co-ord, top y co-ord, width, height */
if (U.userpref == 0) { /* view & ctrl */
uiBlockSetCol(block, BUTGREEN);
uiDefButS(block, TOG|BIT|4, 0, "Scene Global",
389,y2,86,20, &(U.flag), 0, 0, 0, 0,
"Forces the current Scene to be displayed in all Screens");
uiDefButS(block, TOG|BIT|5, 0, "TrackBall",
389,y1,86,20, &(U.flag), 0, 0, 0, 0,
"Switches between trackball and turntable view rotation methods (MiddleMouse)");
uiDefButS(block, TOG|BIT|12, 0, "2-Mouse",
478,y1,86,20, &(U.flag), 0, 0, 0, 0,
"Maps ALT+LeftMouse to MiddleMouse button");
uiDefButS(block, TOG|BIT|9, B_U_CAPSLOCK, "NoCapsLock",
478,y2,86,20, &(U.flag), 0, 0, 0, 0,
"Deactives the CapsLock button (only applies to text input)");
uiDefButS(block, TOG|BIT|10, 0, "Viewmove",
569,y2,78,20, &(U.flag), 0, 0, 0, 0,
"Sets the default action for the middle mouse button");
uiDefButS(block, TOG|BIT|13, 0, "noNumpad",
653,y1,76,20, &(U.flag), 0, 0, 0, 0,
"For laptops: keys 1 to 0 become numpad keys");
uiDefButS(block, TOG|BIT|11, 0, "ToolTips",
653,y2,76,20, &(U.flag), 0, 0, 0, 0,
"Enables/Disables tooltips");
uiDefButS(block, TOG|BIT|1, 0, "Grab Grid", 788,y2,106,20, &(U.flag), 0, 0, 0, 0, "Changes default step mode for grabbing");
uiDefButS(block, TOG|BIT|2, 0, "Rot", 842,y1,52,20, &(U.flag), 0, 0, 0, 0, "Changes default step mode for rotation");
uiDefButS(block, TOG|BIT|3, 0, "Size", 788,y1,52,20, &(U.flag), 0, 0, 0, 0, "Changes default step mode for scaling");
uiDefButI(block, NUM, 0, "WLines",
1153,y2,70,20, &U.wheellinescroll,
0.0, 32.0, 0, 0,
"Mousewheel: The number of lines that get scrolled");
uiDefButS(block, TOG|BIT|2, 0, "WZoom",
1081,y2,70,20, &(U.uiflag), 0, 0, 0, 0,
"Mousewheel: Swaps mousewheel zoom direction");
uiDefButS(block, TOG|BIT|3, 0, "Exts",
1009,y2,70,20, &(U.uiflag), 0, 0, 0, 0,
"ImageSelecter: Filter only filenames with extensions");
uiDefButS(block, TOG|BIT|4, B_DRAWINFO, "DrawInfo",
937,y2,70,20, &(U.uiflag), 0, 0, 0, 0,
"3D View: Display active objectname and current framenumber");
} else if(U.userpref == 1) { /* autosave */
/* uiBlockSetCol(block, BUTBLUE); */
uiDefButS(block, TOG|BIT|0, B_RESETAUTOSAVE, "Auto Save Temp Files",
(xpos+edgespace),y2,medprefbut,buth,
&(U.flag), 0, 0, 0, 0, "Enables/Disables automatically saving temporary files");
/* uiBlockSetCol(block, BUTGREY); */
uiBlockSetCol(block, BUTSALMON);
uiDefBut(block, BUT, B_LOADTEMP, "Open Recent",
(xpos+edgespace),y1,medprefbut,buth,
0, 0, 0, 0, 0, "Opens the most recently saved temporary file");
uiBlockSetCol(block, BUTGREY);
/* uiDefBut(block, TEX, 0, "Dir:",
45,y1,260,buth,
U.tempdir, 1.0, 63.0, 0, 0, "The directory for temp. files"); */
uiDefButI(block, NUM, B_RESETAUTOSAVE, "Minutes:",
(xpos+edgespace+medprefbut+midspace),y2,medprefbut,buth,
&(U.savetime), 1.0, 60.0, 0, 0, "The time in minutes to wait between temp. saves");
// uiBlockSetCol(block, BUTSALMON);
// uiBlockSetCol(block, BUTGREY);
uiDefButS(block, NUM, 0, "Versions:",
(xpos+edgespace+medprefbut+midspace),y1,medprefbut,buth,
&U.versions, 0.0, 32.0, 0, 0, "The number of old versions to maintain when saving");
} else if (U.userpref == 2) { // edit methods
uiDefButS(block, TOG|BIT|8, 0, "Material on Object",
(xpos+edgespace+medprefbut+midspace),y2,medprefbut,buth,
&(U.flag), 0, 0, 0, 0, "Sets whether Material data is linked to Object or ObjData");
uiDefButS(block, TOG|BIT|0, 0, "Auto Key Action",
(xpos+edgespace),y1,medprefbut,buth,
&(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion for actions");
uiDefButS(block, TOG|BIT|1, 0, "Auto Key Object",
(xpos+edgespace),y2,medprefbut,buth,
&(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion for objects");
uiDefBut(block, LABEL,0,"Duplicate With Object:",
(xpos+edgespace+(3*midspace)+(3*medprefbut)+smallprefbut),y3,(largeprefbut),buth,
0, 0, 0, 0, 0, "");
uiDefButS(block, TOG|BIT|0, 0, "Mesh",
(xpos+edgespace+(4*midspace)+(3*medprefbut)+smallprefbut),y2,smallprefbut,buth,
&(U.dupflag), 0, 0, 0, 0, "Causes Mesh data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|9, 0, "Armature",
(xpos+edgespace+(4*midspace)+(3*medprefbut)+smallprefbut),y1,smallprefbut,buth,
&(U.dupflag), 0, 0, 0, 0, "Causes Armature data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|2, 0, "Surface",
(xpos+edgespace+(5*midspace)+(3*medprefbut)+(2*smallprefbut)),y2,smallprefbut,buth,
&(U.dupflag), 0, 0, 0, 0, "Causes Surface data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|6, 0, "Ipo",
(xpos+edgespace+(5*midspace)+(3*medprefbut)+(2*smallprefbut)),y1,smallprefbut,buth,
&(U.dupflag), 0, 0, 0, 0, "Causes Ipo data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|1, 0, "Curve",
(xpos+edgespace+(6*midspace)+(3*medprefbut)+(3*smallprefbut)),y2,smallprefbut,buth,
&(U.dupflag), 0, 0, 0, 0, "Causes Curve data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|7, 0, "Material",
(xpos+edgespace+(6*midspace)+(3*medprefbut)+(3*smallprefbut)),y1,smallprefbut,buth,
&(U.dupflag), 0, 0, 0, 0, "Causes Material data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|3, 0, "Text",
(xpos+edgespace+(7*midspace)+(3*medprefbut)+(4*smallprefbut)),y2,smallprefbut,buth,
&(U.dupflag), 0, 0, 0, 0, "Causes Text data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|8, 0, "Texture",
(xpos+edgespace+(7*midspace)+(3*medprefbut)+(4*smallprefbut)),y1,smallprefbut,buth,
&(U.dupflag), 0, 0, 0, 0, "Causes Texture data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|4, 0, "Metaball",
(xpos+edgespace+(8*midspace)+(3*medprefbut)+(5*smallprefbut)),y2,smallprefbut,buth,
&(U.dupflag), 0, 0, 0, 0, "Causes Metaball data to be duplicated with Shift+D");
uiDefButS(block, TOG|BIT|5, 0, "Lamp",
(xpos+edgespace+(8*midspace)+(3*medprefbut)+(5*smallprefbut)),y1,smallprefbut,buth,
&(U.dupflag), 0, 0, 0, 0, "Causes Lamp data to be duplicated with Shift+D");
} else if (U.userpref == 3) { // system & opengl
/*
uiBlockSetCol(block, BUTGREY);
uiDefButS(block, MENU|SHO, B_CONSOLEOUT, consolemethod_pup(),
45, y2, 260, buth,
&U.console_out, 0, 0, 0, 0, "Select Console method");
uiDefButS(block, TOG|BIT|5, 0, "PrintEvents",
45,y1,130,buth,
&(U.uiflag), 0, 0, 0, 0,
"Console: Print inputevents to console");
uiDefButS(block, NUM, B_CONSOLENUMLINES, "Max Lines:",
175,y1,130,buth,
&U.console_buffer, 1.0, 4000.0, 0, 0,
"Console: Maximum number of Console lines");
*/
uiBlockSetCol(block, BUTYELLOW);
uiDefButI(block, TOG|BIT|USERDEF_VERTEX_ARRAYS_BIT, 0, "Vertex arrays",
400,y2,160,buth,
&(U.gameflags), 0, 0, 0, 0, "Toggle between vertex arrays on (less reliable) and off (more reliable)");
uiDefButI(block, TOG|BIT|USERDEF_DISABLE_MIPMAP_BIT, B_MIPMAPCHANGED, "No Mipmaps",
560,y2,160,buth,
&(U.gameflags), 0, 0, 0, 0, "Toggle between Mipmap textures on (beautiful) and off (fast)");
uiDefButI(block, TOG|BIT|USERDEF_DISABLE_SOUND_BIT, B_SOUNDTOGGLE, "No sound",
400,y1,160,buth,
&(U.gameflags), 0, 0, 0, 0, "Toggle between sound on and sound off");
} else if(U.userpref == 4) { //file paths
dx= (1280-90)/4;
uiDefBut(block, TEX, 0, "Fonts: ",
(xpos+edgespace),y2,(largeprefbut-smfileselbut),buth,
U.fontdir, 1.0, 63.0, 0, 0,
"The default directory to search for loading fonts");
uiDefIconBut(block, BUT, B_FONTDIRFILESEL, ICON_FILESEL,
(xpos+edgespace+largeprefbut-smfileselbut),y2,smfileselbut,buth,
0, 0, 0, 0, 0,
"Select default font path");
uiDefBut(block, TEX, 0, "Textures: ",
(xpos+edgespace+largeprefbut+midspace),y2,(largeprefbut-smfileselbut),buth,
U.textudir, 1.0, 63.0, 0, 0,
"The default directory to search for textures");
uiDefIconBut(block, BUT, B_TEXTUDIRFILESEL, ICON_FILESEL,
(xpos+edgespace+(2*largeprefbut)+midspace-smfileselbut),y2,smfileselbut,buth,
0, 0, 0, 0, 0,
"Select default texture path");
uiDefBut(block, TEX, 0, "TexPlugins: ",
(xpos+edgespace+(2*largeprefbut)+(2*midspace)),y2,(largeprefbut-smfileselbut),buth,
U.plugtexdir, 1.0, 63.0, 0, 0,
"The default directory to search for texture plugins");
uiDefIconBut(block, BUT, B_PLUGTEXDIRFILESEL, ICON_FILESEL,
(xpos+edgespace+(3*largeprefbut)+(2*midspace)-smfileselbut),y2,smfileselbut,buth,
0, 0, 0, 0, 0,
"Select default texture plugin path");
uiDefBut(block, TEX, 0, "SeqPlugins: ",
(xpos+edgespace+(3*largeprefbut)+(3*midspace)),y2,(largeprefbut-smfileselbut),buth,
U.plugseqdir, 1.0, 63.0, 0, 0,
"The default directory to search for sequence plugins");
uiDefIconBut(block, BUT, B_PLUGSEQDIRFILESEL, ICON_FILESEL,
(xpos+edgespace+(4*largeprefbut)+(3*midspace)-smfileselbut),y2,smfileselbut,buth,
0, 0, 0, 0, 0,
"Select default sequence plugin path");
uiDefBut(block, TEX, 0, "Render: ",
(xpos+edgespace),y1,(largeprefbut-smfileselbut),buth,
U.renderdir, 1.0, 63.0, 0, 0,
"The default directory for rendering output");
uiDefIconBut(block, BUT, B_RENDERDIRFILESEL, ICON_FILESEL,
(xpos+edgespace+largeprefbut-smfileselbut),y1,smfileselbut,buth,
0, 0, 0, 0, 0,
"Select default render path");
uiDefBut(block, TEX, 0, "Python: ",
(xpos+edgespace+largeprefbut+midspace),y1,(largeprefbut-smfileselbut),buth,
U.pythondir, 1.0, 63.0, 0, 0,
"The default directory to search for Python scripts");
uiDefIconBut(block, BUT, B_PYTHONDIRFILESEL, ICON_FILESEL,
(xpos+edgespace+(2*largeprefbut)+midspace-smfileselbut),y1,smfileselbut,buth,
0, 0, 0, 0, 0,
"Select default Python script path");
uiDefBut(block, TEX, 0, "Sounds: ",
(xpos+edgespace+(2*largeprefbut)+(2*midspace)),y1,(largeprefbut-smfileselbut),buth,
U.sounddir, 1.0, 63.0, 0, 0,
"The default directory to search for sounds");
uiDefIconBut(block, BUT, B_SOUNDDIRFILESEL, ICON_FILESEL,
(xpos+edgespace+(3*largeprefbut)+(2*midspace)-smfileselbut),y1,smfileselbut,buth,
0, 0, 0, 0, 0,
"Select default sound path");
uiDefBut(block, TEX, 0, "Temp: ",
(xpos+edgespace+(3*largeprefbut)+(3*midspace)),y1,(largeprefbut-smfileselbut),buth,
U.tempdir, 1.0, 63.0, 0, 0, "The directory for storing temporary save files");
uiDefIconBut(block, BUT, B_TEMPDIRFILESEL, ICON_FILESEL,
(xpos+edgespace+(4*largeprefbut)+(3*midspace)-smfileselbut),y1,smfileselbut,buth,
0, 0, 0, 0, 0,
"Select default temporary save file path");
} else if(U.userpref == 5) { //language & colors
dx= (1280-90)/6;
#ifdef INTERNATIONAL
uiBlockSetCol(block, BUTSALMON);
uiDefBut(block, BUT, B_LOADUIFONT, "Load UI Font",
xpos,y2,(short)dx-10,buth,
0, 0, 0, 0, 0, "Load new font for the interface");
uiBlockSetCol(block, BUTGREY);
uiDefButS(block, MENU|SHO, B_SETLANGUAGE, language_pup(),
xpos + (short)dx,y2,(short)dx-10,buth,
&U.language, 0, 0, 0, 0, "Choose interface language");
uiDefButS(block, MENU|SHO, B_SETENCODING, encoding_pup(),
xpos,y1,(short)dx-10,buth,
&U.encoding, 0, 0, 0, 0, "Set font encoding");
uiDefButI(block, MENU|INT, B_SETFONTSIZE, fontsize_pup(),
xpos + (short)dx,y1,(short)dx-10,buth,
&U.fontsize, 0, 0, 0, 0, "Set font size");
uiDefBut(block, LABEL,0,U.fontname,
xpos,y3,(short)dx-10,buth,
0, 0, 0, 0, 0, "");
xpos = 320;
dx= (1280-90)/7.5;
uiDefButS(block, TOG|BIT|0, B_SETTRANSBUTS, "Translate Tooltips",
xpos + (short)dx,y2,(short)dx,buth,
&(U.transopts), 0, 0, 0, 0, "Apply translation to tooltips");
uiDefButS(block, TOG|BIT|1, B_SETTRANSBUTS, "Translate Buttons",
xpos + (short)dx,y1,(short)dx,buth,
&(U.transopts), 0, 0, 0, 0, "Apply translation to button titles");
uiDefButS(block, TOG|BIT|2, B_SETTRANSBUTS, "Translate Toolbox",
xpos + (short)2*dx,y2,(short)dx,buth,
&(U.transopts), 0, 0, 0, 0, "Apply translation to toolbox menu");
uiBlockSetCol(block, BUTSALMON);
uiDefButS(block, TOG|BIT|3, B_SETTRANSBUTS, "FTF All windows",
xpos + (short)2*dx,y1,(short)dx,buth,
&(U.transopts), 0, 0, 0, 0,
"Use FTF drawing for fileselect and textwindow "
"(under construction)");
/* end of INTERNATIONAL */
#endif
}
uiDrawBlock(block);
}
void winqreadinfospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
{
unsigned short event= evt->event;

@ -79,6 +79,8 @@
#include "BIF_editseq.h"
#include "BIF_editlattice.h"
#include "BIF_editsima.h"
#include "BIF_editoops.h"
#include "BIF_imasel.h"
#include "BIF_screen.h"
#include "BIF_tbcallback.h"
#include "BIF_editnla.h"
@ -89,6 +91,7 @@
#include "BSE_editipo.h"
#include "BSE_buttons.h"
#include "BSE_filesel.h"
#include "IMB_imbuf.h"
@ -1424,11 +1427,21 @@ void clever_numbuts(void)
else if(curarea->spacetype==SPACE_IMAGE) {
clever_numbuts_sima();
}
else if(curarea->spacetype==SPACE_IMASEL) {
clever_numbuts_imasel();
}
else if(curarea->spacetype==SPACE_BUTS){
clever_numbuts_buts();
}
else if(curarea->spacetype==SPACE_OOPS) {
clever_numbuts_oops();
}
// else if(curarea->spacetype==SPACE_ACTION){
// stupid_damn_numbuts_action();
// }
else if(curarea->spacetype==SPACE_FILE) {
clever_numbuts_filesel();
}
}