Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7443 → Rev 7444

/programs/cmm/notes/engine.h
116,6 → 116,7
COL_BOTTOM_LINE=0xE8EFF4,
COL_BG,
cur_text;
int drawy;
char line_text[4096];
if (line_n<0) return;
x = 1;
131,10 → 132,12
}
else
{
DefineButton(RED_LINE_X-CHBOX/2+x, item_h*line_n+5+y, CHBOX-1,CHBOX-1, CHECKBOX_ID+line_n+BT_HIDE, 0); //checkbox
_PutImage(RED_LINE_X-CHBOX/2+x, item_h*line_n+5+y, CHBOX,CHBOX, lines[line_n].state*CHBOX*CHBOX*3+#checkbox);
if (cur_text) WriteText(x+RED_LINE_X+6, item_h*line_n+7+y, 0x80, lines[line_n].state*0x777777, cur_text);
if (lines[line_n].state == true) DrawBar(x+RED_LINE_X+6, item_h*line_n+11+y, strlen(cur_text)*6, 1, 0x444444); //strike
drawy = item_h*line_n+5+y;
DefineButton(RED_LINE_X-CHBOX/2+x, drawy, CHBOX-1,CHBOX-1, CHECKBOX_ID+line_n+BT_HIDE, 0); //checkbox
_PutImage(RED_LINE_X-CHBOX/2+x,drawy, CHBOX,CHBOX, lines[line_n].state*CHBOX*CHBOX*3+#checkbox);
if (cur_text) WriteText(x+RED_LINE_X+6, drawy+2, 0x80, lines[line_n].state*0x777777, cur_text);
if (lines[line_n].state == true) DrawBar(x+RED_LINE_X+6, drawy+6, strlen(cur_text)*6, 1, 0x444444); //strike
DrawBar(WIN_W,drawy,1,item_h,0xBBBBBB); //fast fix; proper fix is to restrict WriteText() char length
}
DrawBar(x, line_n*item_h+draw_h-1+y, w, 1, COL_BOTTOM_LINE);
DrawBar(x+RED_LINE_X, line_n*item_h+y, 1, draw_h, COL_RED_LINE);
/programs/cmm/notes/notes.c
1,4 → 1,4
// Notes v1.0
// Notes v1.1
 
#define MEMSIZE 0xDAE80
#include "..\lib\kolibri.h"
47,6 → 47,7
dword lists[] = { 0xEAEAEA, 0xCDCDCD, 0xF0F0F0, 0xD8D8D8, 0 };
 
bool delete_active = false;
bool window_dragable = true;
block delBtn;
 
//===================================================//
62,6 → 63,8
dword cur_line_offset;
load_dll(boxlib, #box_lib_init,0);
if (GetCpuFrequency()/1000000>=1000) window_dragable=true; else window_dragable=false;
if (param) notes.OpenTxt(#param); else notes.OpenTxt(abspath("notes.txt"));
 
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
75,7 → 78,8
 
if (delete_active) && (delBtn.hovered()) break;
 
if (mouse.lkm) && (mouse.y<TITLE_H) && (mouse.x<WIN_W-39) EventDragWindow();
if (mouse.lkm) && (mouse.y<TITLE_H) && (mouse.x<WIN_W-39)
&& (window_dragable) EventDragWindow();
 
if (mouse.pkm)
&& (notes.MouseOver(mouse.x, mouse.y)) {
159,7 → 163,10
void draw_window()
{
int i;
if (window_dragable)
DefineUnDragableWindow(100,100,WIN_W, WIN_H);
else
DefineDragableWindow(100,100,WIN_W, WIN_H);
notes.SetSizes(RED_LINE_X+1, HEADER_HEIGHT, WIN_W-1, RED_LINE_X*LINES_COUNT, RED_LINE_X);
DrawRectangle3D(0,0,WIN_W,TITLE_H-1,0xBB6535, 0xCD6F3B);
DrawRectangle3D(1,1,WIN_W-2,TITLE_H-3,0xEFBFA4, 0xDD8452);
196,7 → 203,7
 
void EventActivateLine(int line_n)
{
if (line_n<0) || (line_n>notes.count) return;
if (line_n<0) || (line_n>=notes.count) return;
notes.cur_y = line_n;
notebox.text = notes.DrawLine(notes.cur_y, notes.item_h);
EventListRedraw();