Rev 6371 | Rev 6379 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
255 | heavyiron | 1 | ;******************************************************* |
2 | ;**************GRAPHICS EDITOR ANIMAGE ***************** |
||
3 | ;******************************************************* |
||
6367 | leency | 4 | ; version: 1.51 |
5 | ; last update: 23.03.2016 |
||
6 | ; changes: Use library 'kmenu.obj', update GUI |
||
7 | ; autors: IgorA, Veliant, Leency |
||
6359 | IgorA | 8 | ;-------------------------------------------------------- |
6328 | IgorA | 9 | ; version: 1.4 |
6359 | IgorA | 10 | ; last update: 12.03.2016 |
6328 | IgorA | 11 | ; changes: Use library 'libimg.obj' |
6359 | IgorA | 12 | ; autors: IgorA |
6328 | IgorA | 13 | ;-------------------------------------------------------- |
6359 | IgorA | 14 | ; version: 1.3 |
15 | ; last update: 05.10.2010 |
||
1643 | mario79 | 16 | ; written by: Marat Zakiyanov aka Mario79, aka Mario |
17 | ; changes: Fixed window flicker when redrawing, |
||
18 | ; Fixed memory leak for stack |
||
19 | ;-------------------------------------------------------- |
||
6359 | IgorA | 20 | ; version: 1.2 |
21 | ; last update: 30.09.2010 |
||
1632 | mario79 | 22 | ; written by: Marat Zakiyanov aka Mario79, aka Mario |
23 | ; changes: Program used function 68 instead 64 is now, |
||
24 | ; select path with OpenDialog |
||
25 | ;-------------------------------------------------------- |
||
6359 | IgorA | 26 | ; version: 1.1 |
27 | ; last update: 09.12.2006 |
||
28 | ; autors: |
||
255 | heavyiron | 29 | ; programming by andrew_programmer |
1632 | mario79 | 30 | ; design by golus |
255 | heavyiron | 31 | |
180 | heavyiron | 32 | use32 |
1632 | mario79 | 33 | org 0x0 |
34 | db 'MENUET01' |
||
6360 | IgorA | 35 | dd 1, START, IM_END, I_END |
36 | dd stacktop, file_path, cur_dir_path |
||
255 | heavyiron | 37 | |
6360 | IgorA | 38 | include '../../../config.inc' ;for nightbuild |
6328 | IgorA | 39 | include '../../../macros.inc' |
40 | include '../../../proc32.inc' |
||
41 | include '../../../KOSfuncs.inc' |
||
1632 | mario79 | 42 | include '../../../develop/libraries/box_lib/load_lib.mac' |
6328 | IgorA | 43 | include '../../../dll.inc' |
44 | include '../../../libio.inc' |
||
6360 | IgorA | 45 | ;include '../../../develop/libraries/libs-dev/libimg/libimg.inc' |
6328 | IgorA | 46 | |
47 | @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load |
||
48 | |||
6357 | IgorA | 49 | ;--------------------------------------------------------- |
50 | ; *** константы для интерфейса *** |
||
6358 | IgorA | 51 | ; *** constants for interface *** |
6357 | IgorA | 52 | |
6358 | IgorA | 53 | ; корректировки на скин |
6359 | IgorA | 54 | ci_offs_skin_w equ 5 ;корректировка на ширину рамки скина |
55 | ci_offs_skin_h equ 24 ;корректировка на высоту скина |
||
6358 | IgorA | 56 | |
57 | ; главное окно |
||
58 | ci_wnd_min_siz_x equ 585 ;minimum size x |
||
59 | ci_wnd_min_siz_y equ 400 ;minimum size y |
||
60 | |||
6359 | IgorA | 61 | ; панель инструментов |
6371 | IgorA | 62 | ci_panel_x_pos equ 0 ;коорд. x для панели |
63 | ci_panel_y_pos equ 20 ;коорд. y для панели |
||
64 | ci_panel_but_y1 equ ci_panel_y_pos +5 ;коорд. y для 1-го ряда кнопок |
||
65 | ci_panel_but_y2 equ ci_panel_y_pos+30 ;коорд. y для 2-го ряда кнопок |
||
66 | ci_palete_y_pos equ ci_panel_y_pos+51 ;коорд. y для палитры цветов |
||
67 | ci_panel_zoom_x equ 178 ;коорд. x для кнопок панели масштаба |
||
6359 | IgorA | 68 | |
6357 | IgorA | 69 | ; окно редактора |
6371 | IgorA | 70 | ci_edit_wnd_x_pos equ 0 ;коорд. x для окна редактора |
71 | ci_edit_wnd_y_pos equ 71 ;коорд. y для окна редактора |
||
6357 | IgorA | 72 | ci_edit_wnd_border equ 3 ;рамка вокруг окна редактора |
73 | |||
74 | ; скроллинги |
||
6358 | IgorA | 75 | ci_scroll_dim equ 22 ;размеры скроллингов |
6357 | IgorA | 76 | ci_scrollh_coord_x_min equ (ci_edit_wnd_x_pos+3) ;минимальная позиция ползунка |
77 | ;горизонтального скроллинга |
||
78 | ci_scrollv_coord_y_min equ (ci_edit_wnd_y_pos+3) ;минимальная позиция ползунка |
||
79 | ;вертикального скроллинга |
||
80 | ;--------------------------------------------------------- |
||
81 | |||
1632 | mario79 | 82 | include 'bmplib.inc' |
83 | include 'dialog2.inc' |
||
84 | include 'design.inc' |
||
85 | include 'graphlib.inc' |
||
255 | heavyiron | 86 | |
1632 | mario79 | 87 | include 'cursors.inc' |
6342 | IgorA | 88 | include 'memory.inc' |
1632 | mario79 | 89 | include 'load_from_parameters.inc' |
255 | heavyiron | 90 | |
180 | heavyiron | 91 | START: |
6329 | IgorA | 92 | mcall SF_SYS_MISC,SSF_HEAP_INIT |
6359 | IgorA | 93 | mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, syscolors, syscolors_end-syscolors |
1632 | mario79 | 94 | |
95 | load_libraries l_libs_start,end_l_libs |
||
180 | heavyiron | 96 | |
1632 | mario79 | 97 | cmp eax,-1 |
98 | jz close |
||
6357 | IgorA | 99 | |
6329 | IgorA | 100 | mcall SF_SET_EVENTS_MASK,0x80000067 ; 1100111b |
180 | heavyiron | 101 | ;--------------------------------------------------------- |
255 | heavyiron | 102 | ;-----------------------init data------------------------- |
180 | heavyiron | 103 | ;--------------------------------------------------------- |
1632 | mario79 | 104 | include 'init_data.inc' |
105 | |||
180 | heavyiron | 106 | ;---------------------------------------------------------- |
107 | ;--------get memory and draw window of program------------- |
||
108 | ;---------------------------------------------------------- |
||
6365 | IgorA | 109 | call GetMemory |
110 | mov [Current_instrument],10 ;pencil |
||
111 | call TakeButtonInstruments ;set startup instrument |
||
112 | call cleare_work_arrea |
||
113 | call load_icons |
||
114 | call init_main_menu |
||
255 | heavyiron | 115 | |
6329 | IgorA | 116 | ;load cursors |
1632 | mario79 | 117 | mov eax,CursorsID |
6365 | IgorA | 118 | call load_cursors |
255 | heavyiron | 119 | |
120 | ;--------------------------------------------------------- |
||
6364 | IgorA | 121 | ;---------check loading of file from parameters----------- |
255 | heavyiron | 122 | ;--------------------------------------------------------- |
1632 | mario79 | 123 | mov eax,file_path |
124 | cmp [eax],byte 0 |
||
125 | jz @f |
||
126 | call load_picture |
||
6328 | IgorA | 127 | call MovePictureToWorkScreen |
1632 | mario79 | 128 | @@: |
255 | heavyiron | 129 | |
1632 | mario79 | 130 | ;--------------------------------------------------------------------- |
131 | mov edi,filename_area |
||
132 | mov esi,path4+5 |
||
133 | call copy_str_1 |
||
134 | |||
135 | mov edi,file_path |
||
136 | cmp [edi],byte 0 |
||
137 | jne @f |
||
138 | mov esi,path4 |
||
139 | call copy_str_1 |
||
140 | @@: |
||
141 | ;OpenDialog initialisation |
||
6360 | IgorA | 142 | stdcall [OpenDialog_Init], OpenDialog_data |
1632 | mario79 | 143 | ;--------------------------------------------------------------------- |
6364 | IgorA | 144 | |
145 | align 4 |
||
6358 | IgorA | 146 | red: |
6364 | IgorA | 147 | call drawwin |
180 | heavyiron | 148 | ;---------------------------------------------------------- |
6364 | IgorA | 149 | ;---------------------main loop---------------------------- |
180 | heavyiron | 150 | ;---------------------------------------------------------- |
6358 | IgorA | 151 | align 4 |
1632 | mario79 | 152 | still: |
6364 | IgorA | 153 | mcall SF_WAIT_EVENT |
1643 | mario79 | 154 | |
1632 | mario79 | 155 | cmp eax,1 |
1643 | mario79 | 156 | je red |
255 | heavyiron | 157 | |
1632 | mario79 | 158 | cmp eax,2 |
159 | je keys |
||
180 | heavyiron | 160 | |
1632 | mario79 | 161 | cmp eax,3 |
162 | je buttons |
||
255 | heavyiron | 163 | |
1632 | mario79 | 164 | cmp eax,6 |
165 | je mouse |
||
255 | heavyiron | 166 | |
1632 | mario79 | 167 | jmp still |
168 | |||
169 | ;--------------------------------------------------------------------- |
||
170 | copy_str_1: |
||
171 | xor eax,eax |
||
172 | cld |
||
173 | @@: |
||
174 | lodsb |
||
175 | stosb |
||
176 | test eax,eax |
||
177 | jnz @b |
||
178 | ret |
||
179 | ;--------------------------------------------------------------------- |
||
180 | include 'events.inc' |
||
181 | include 'events_of_window.inc' |
||
182 | include 'events_of_keys.inc' |
||
183 | include 'events_of_buttons.inc' |
||
184 | include 'events_of_mouse.inc' |
||
185 | include 'panel_engen.inc' |
||
186 | include 'screen.inc' |
||
1643 | mario79 | 187 | include 'menu_instruments.inc' |
1632 | mario79 | 188 |