Overview
| Comment: | Some more display in the margin in the editor |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
31ac1ffcb30ae65a0b060eaf344c8249 |
| User & Date: | user on 2018-10-23 03:16:39.360 |
| Other Links: | manifest | tags |
Context
|
2018-10-23
| ||
| 03:31 | Add implementation of loading level index check-in: 17b9aedf92 user: user tags: trunk | |
| 03:16 | Some more display in the margin in the editor check-in: 31ac1ffcb3 user: user tags: trunk | |
|
2018-10-22
| ||
| 05:41 | More stuff in editor and key binding check-in: 02cc36cf71 user: user tags: trunk | |
Changes
Modified bindings.c
from [cc5c5337c8]
to [7677516cfd].
| ︙ | |||
161 162 163 164 165 166 167 168 169 170 171 172 | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | + - + |
const UserCommand*cmd=find_key_binding(ev,editing);
int prev=0;
int i,j,k;
const char*name;
if(ev->type==SDL_MOUSEBUTTONDOWN && !x && !y && ev->button.x>=left_margin) {
x=(ev->button.x-left_margin)/picture_size+1;
y=ev->button.y/picture_size+1;
if(x<1 || y<1 || x>pfwidth || y>pfheight) return 0;
}
switch(cmd->cmd) {
case 0:
return 0;
case '^':
|
| ︙ | |||
201 202 203 204 205 206 207 208 209 210 211 212 213 214 | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | + |
}
}
while((i=sqlite3_step(cmd->stmt))==SQLITE_ROW) {
if(i=sqlite3_data_count(cmd->stmt)) {
j=i>1?sqlite3_column_int(cmd->stmt,1):0;
if((name=sqlite3_column_text(cmd->stmt,0)) && *name) {
k=name[0]*'\1\0'+name[1]*'\0\1';
while(i && sqlite3_column_type(cmd->stmt,i-1)==SQLITE_NULL) i--;
prev=cb(prev,k,j,i,cmd->stmt,aux);
if(prev<0) {
i=SQLITE_DONE;
break;
}
}
}
|
| ︙ |
Modified edit.c
from [47203e30e6]
to [e979aee854].
| ︙ | |||
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
#include "sqlite3.h"
#include "smallxrm.h"
#include "heromesh.h"
#include "quarks.h"
#include "cursorshapes.h"
static void redraw_editor(void) {
char buf[32];
SDL_Rect r;
int x,y;
r.x=r.y=0;
r.h=screen->h;
r.w=left_margin;
SDL_FillRect(screen,&r,0xF0);
r.x=left_margin-1;
r.w=1;
SDL_FillRect(screen,&r,0xF7);
r.x=left_margin;
r.w=screen->w-r.x;
SDL_FillRect(screen,&r,back_color);
for(x=1;x<=pfwidth;x++) for(y=1;y<=pfheight;y++) draw_cell(x,y);
x=y=0;
SDL_GetMouseState(&x,&y);
SDL_LockSurface(screen);
if(left_margin>=88) {
snprintf(buf,32,"%5d/%5d",level_ord,level_nindex);
|
| ︙ | |||
75 76 77 78 79 80 81 82 83 84 85 86 87 88 | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | + |
redraw_editor();
break;
case SDL_QUIT:
exit(0);
break;
case SDL_MOUSEMOTION:
set_cursor(ev.motion.x<left_margin?XC_arrow:XC_tcross);
show_mouse_xy(&ev);
break;
case SDL_MOUSEBUTTONDOWN:
// fallthrough
case SDL_KEYDOWN:
i=exec_key_binding(&ev,1,0,0,editor_command,0);
if(i==-1) exit(0);
|
| ︙ |