added function swap_tabs() (wip)
This commit is contained in:
parent
0244dc5e69
commit
6e2754020b
|
|
@ -3751,6 +3751,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
* testmode */
|
||||
else if(!strcmp(argv[1], "test"))
|
||||
{
|
||||
swap_tabs(0, 1);
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
|
|
|
|||
33
src/xinit.c
33
src/xinit.c
|
|
@ -1179,6 +1179,39 @@ void preview_window(const char *what, const char *win_path, const char *fname)
|
|||
semaphore--;
|
||||
}
|
||||
|
||||
|
||||
void swap_tabs(int i, int j)
|
||||
{
|
||||
int wc = window_count;
|
||||
if(wc && j <=wc && i <= wc && j!=i) {
|
||||
Xschem_ctx *ctx;
|
||||
char *tmp;
|
||||
|
||||
|
||||
tmp = save_xctx[i]->top_path;
|
||||
save_xctx[i]->top_path = save_xctx[j]->top_path;
|
||||
save_xctx[j]->top_path = tmp;
|
||||
|
||||
tmp = save_xctx[i]->current_win_path;
|
||||
save_xctx[i]->current_win_path = save_xctx[j]->current_win_path;
|
||||
save_xctx[j]->current_win_path = tmp;
|
||||
|
||||
ctx = save_xctx[i];
|
||||
save_xctx[i] = save_xctx[j];
|
||||
save_xctx[j] = ctx;
|
||||
|
||||
/* update filenames on tab buttons */
|
||||
ctx = xctx;
|
||||
xctx = save_xctx[i];
|
||||
set_modify(-1);
|
||||
xctx = save_xctx[j];
|
||||
set_modify(-1);
|
||||
xctx = ctx;
|
||||
set_modify(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* check if filename is already loaded into a tab or window */
|
||||
/* caller should supply a win_path string for storing matching window path */
|
||||
int check_loaded(const char *f, char *win_path)
|
||||
|
|
|
|||
|
|
@ -1332,6 +1332,7 @@ extern void mem_delete_undo(void);
|
|||
extern void mem_clear_undo(void);
|
||||
extern void load_schematic(int load_symbol, const char *fname, int reset_undo, int alert);
|
||||
/* check if filename already in an open window/tab */
|
||||
extern void swap_tabs(int i, int j);
|
||||
extern int check_loaded(const char *f, char *win_path);
|
||||
extern char *get_window_path(int i);
|
||||
extern int get_window_count(void);
|
||||
|
|
|
|||
Loading…
Reference in New Issue