Subversion Repositories Kolibri OS

Rev

Rev 7941 | Rev 7957 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7941 Rev 7945
Line 53... Line 53...
53
int user_encoding;
53
int user_encoding;
54
int real_encoding = CH_CP866;
54
int real_encoding = CH_CP866;
55
int curcol_scheme;
55
int curcol_scheme;
56
int font_size;
56
int font_size;
Line -... Line 57...
-
 
57
 
-
 
58
bool enable_edit = false;
57
 
59
 
Line 58... Line 60...
58
#include "data.h"
60
#include "data.h"
59
 
61
 
60
#include "search.h"
62
#include "search.h"
Line 253... Line 255...
253
	}
255
	}
Line 254... Line 256...
254
 
256
 
255
	if (list.ProcessKey(key_scancode)) {
257
	if (list.ProcessKey(key_scancode)) {
256
		if (key_modifier & KEY_LSHIFT) || (key_modifier & KEY_RSHIFT) selection.set_end();
258
		if (key_modifier & KEY_LSHIFT) || (key_modifier & KEY_RSHIFT) selection.set_end();
-
 
259
		DrawPage();
257
		DrawPage();
260
		return;
258
	}
261
	}
259
	//EventInsertCharIntoText();
262
	if(enable_edit) EventInsertCharIntoText();
Line 260... Line 263...
260
}
263
}
261
 
264
 
262
void HandleMouseEvent()
265
void HandleMouseEvent()
Line 312... Line 315...
312
 
315
 
313
bool EventSearchNext()
316
bool EventSearchNext()
314
{
317
{
315
	int new_y = search.find_next(list.first);
318
	int new_y = search.find_next(list.first);
316
	if (new_y) {
319
	if (new_y) {
317
		list.first = new_y / list.item_h;
320
		list.first = new_y;
318
		list.CheckDoesValuesOkey();
321
		list.CheckDoesValuesOkey();
319
		DrawPage();		
322
		DrawPage();		
320
	}
323
	}
Line 574... Line 577...
574
	Clipboard__CopyText(#param);
577
	Clipboard__CopyText(#param);
575
	sprintf(#copy_status_text, #copied_chars, strlen(#param));
578
	sprintf(#copy_status_text, #copied_chars, strlen(#param));
576
	DrawStatusBar(#copy_status_text);
579
	DrawStatusBar(#copy_status_text);
577
}
580
}
Line -... Line 581...
-
 
581
 
-
 
582
void EventEnableEdit()
-
 
583
{
-
 
584
	enable_edit ^= 1;
-
 
585
	if (enable_edit) notify("'Edit mode is enabled.\nNow you can only replace text, not insert, nor delete.'I");
-
 
586
	draw_window();
-
 
587
}
578
 
588
 
579
//===================================================//
589
//===================================================//
580
//                                                   //
590
//                                                   //
581
//               DRAWS AND OTHER FUNCS               //
591
//               DRAWS AND OTHER FUNCS               //
582
//                                                   //
592
//                                                   //
Line 636... Line 646...
636
	if (menu_id == REOPEN_IN_APP) reopa = true;
646
	if (menu_id == REOPEN_IN_APP) reopa = true;
Line 637... Line 647...
637
 
647
 
638
	DrawBar(0, 0, Form.cwidth, TOOLBAR_H - 1, sc.work);
648
	DrawBar(0, 0, Form.cwidth, TOOLBAR_H - 1, sc.work);
Line -... Line 649...
-
 
649
	DrawBar(0, TOOLBAR_H - 1, Form.cwidth, 1, sc.work_graph);
639
	DrawBar(0, TOOLBAR_H - 1, Form.cwidth, 1, sc.work_graph);
650
	
640
	
651
	x.set(-SMALL_GAP+8);
641
	//AddTopBarButton(#EventNewFile,        ECTRL+SCAN_CODE_KEY_N, 2,  x.set(8),         false);
652
	if(enable_edit) AddTopBarButton(#EventNewFile,        ECTRL+SCAN_CODE_KEY_N, 2,  x.inc(SMALL_GAP), false);
642
	AddTopBarButton(#EventOpenDialog,     ECTRL+SCAN_CODE_KEY_O, 0,  x.set(8), false);
653
	                AddTopBarButton(#EventOpenDialog,     ECTRL+SCAN_CODE_KEY_O, 0,  x.inc(SMALL_GAP), false);
643
	//AddTopBarButton(#EventSave,           ECTRL+SCAN_CODE_KEY_S, 5,  x.inc(SMALL_GAP), false);
654
	if(enable_edit) && (param[0]) AddTopBarButton(#EventSave,           ECTRL+SCAN_CODE_KEY_S, 5,  x.inc(SMALL_GAP), false);
644
	AddTopBarButton(#EventShowFileInfo,   ECTRL+SCAN_CODE_KEY_I, 10, x.inc(SMALL_GAP), false);
655
	                AddTopBarButton(#EventShowFileInfo,   ECTRL+SCAN_CODE_KEY_I, 10, x.inc(SMALL_GAP), false);
645
	AddTopBarButton(#EventMagnifyMinus,   ECTRL+SCAN_CODE_MINUS, 33, x.inc(BIG_GAP),   false);
656
	                AddTopBarButton(#EventMagnifyMinus,   ECTRL+SCAN_CODE_MINUS, 33, x.inc(BIG_GAP),   false);
646
	AddTopBarButton(#EventMagnifyPlus,    ECTRL+SCAN_CODE_PLUS,  32, x.inc(SMALL_GAP), false);
657
	                AddTopBarButton(#EventMagnifyPlus,    ECTRL+SCAN_CODE_PLUS,  32, x.inc(SMALL_GAP), false);
-
 
658
	                AddTopBarButton(#EventClickSearch,    ECTRL+SCAN_CODE_KEY_F, 49, x.inc(BIG_GAP),   serha);  search_mx = EAX;
647
	AddTopBarButton(#EventClickSearch,    ECTRL+SCAN_CODE_KEY_F, 49, x.inc(BIG_GAP),   serha);  search_mx = EAX;
659
	x.set(Form.cwidth-4);
648
	x.set(Form.cwidth-4);
660
	                AddTopBarButton(#EventEnableEdit,       NULL,                  38, x.inc(-SMALL_GAP), enable_edit);
649
	//AddTopBarButton(#EventShowInfo,       NULL,                  -1, x.inc(-SMALL_GAP), false); burger_mx = EAX;
661
	//if(enable_edit) AddTopBarButton(#EventShowInfo,       NULL,                  -1, x.inc(-SMALL_GAP), false); burger_mx = EAX;
650
	AddTopBarButton(#EventShowThemesList, NULL,                  40, x.inc(-SMALL_GAP), thema); theme_mx = EAX;
662
	                AddTopBarButton(#EventShowThemesList, NULL,                  40, x.inc(-BIG_GAP), thema); theme_mx = EAX;
651
	AddTopBarButton(#EventShowReopenMenu, ECTRL+SCAN_CODE_KEY_E, 16, x.inc(-SMALL_GAP),   reopa); reopenin_mx = EAX;
663
	                AddTopBarButton(#EventShowReopenMenu, ECTRL+SCAN_CODE_KEY_E, 16, x.inc(-SMALL_GAP),   reopa); reopenin_mx = EAX;
652
	//AddTopBarButton(#EventOpenSysfuncs,   NULL,                  18, x.inc(-SMALL_GAP), false);
664
	if(enable_edit) AddTopBarButton(#EventOpenSysfuncs,   NULL,                  18, x.inc(-SMALL_GAP), false);
Line 653... Line 665...
653
	//AddTopBarButton(#EventOpenPipet,      NULL,                  39, x.inc(-SMALL_GAP), false);
665
	if(enable_edit) AddTopBarButton(#EventOpenPipet,      NULL,                  39, x.inc(-SMALL_GAP), false);
654
}
666
}
655
 
667
 
Line 717... Line 729...
717
	if (font_size == 'S') list.SetFont(6, 9, 00001000b);
729
	if (font_size == 'S') list.SetFont(6, 9, 00001000b);
718
	if (font_size == 'M') list.SetFont(8, 14, 00011000b);
730
	if (font_size == 'M') list.SetFont(8, 14, 00011000b);
719
	list.item_w = list.font_w;
731
	list.item_w = list.font_w;
720
	list.horisontal_selelection = true;
732
	list.horisontal_selelection = true;
721
	list.SetSizes(0, TOOLBAR_H, Form.cwidth-scroll.size_x-1, 
733
	list.SetSizes(0, TOOLBAR_H, Form.cwidth-scroll.size_x-1, 
722
		Form.cheight - TOOLBAR_H - search.height() - STATUSBAR_H /*- TAB_H*/, 
734
		Form.cheight - TOOLBAR_H - calc(search.visible * SEARCH_H) - STATUSBAR_H /*- TAB_H*/, 
723
		math.round(list.font_h * 1.4));
735
		math.round(list.font_h * 1.4));
724
}
736
}
725
737