From 21d1027a5a90338022837b4af32de5dbba1b56ea Mon Sep 17 00:00:00 2001 From: andrew_programmer Date: Mon, 19 Nov 2007 17:44:47 +0000 Subject: [PATCH] Function RemoveComponent is renamed in MoveComponent. New function is added. void ActivateTrapForSpecializedMessage (dword *control) - to activate a trap for the specialized messages. git-svn-id: svn://kolibrios.org@675 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../libGUI/examples/bookmarks/bookmark.asm | 12 ++-- .../examples/progress_bar/progress_bar.asm | 16 ++++- programs/develop/libGUI/src/VERSION.INC | 2 +- programs/develop/libGUI/src/activate_trap.inc | 16 +++++ programs/develop/libGUI/src/bookmark.inc | 6 +- programs/develop/libGUI/src/button.inc | 16 ++--- programs/develop/libGUI/src/check_box.inc | 3 + programs/develop/libGUI/src/edit_box.inc | 3 + programs/develop/libGUI/src/image.inc | 8 +-- programs/develop/libGUI/src/libGUI.asm | 23 +++++-- ...emove_component.inc => move_component.inc} | 6 +- programs/develop/libGUI/src/number.inc | 12 ++-- programs/develop/libGUI/src/progress_bar.inc | 28 ++++---- programs/develop/libGUI/src/scroller.inc | 23 +++---- programs/develop/libGUI/src/text.inc | 4 +- programs/develop/libGUI/whats new.txt | 66 +++++++++++++++++++ 16 files changed, 177 insertions(+), 67 deletions(-) create mode 100644 programs/develop/libGUI/src/activate_trap.inc rename programs/develop/libGUI/src/{remove_component.inc => move_component.inc} (66%) create mode 100644 programs/develop/libGUI/whats new.txt diff --git a/programs/develop/libGUI/examples/bookmarks/bookmark.asm b/programs/develop/libGUI/examples/bookmarks/bookmark.asm index 3d1c0dc09..84eab538e 100644 --- a/programs/develop/libGUI/examples/bookmarks/bookmark.asm +++ b/programs/develop/libGUI/examples/bookmarks/bookmark.asm @@ -56,10 +56,10 @@ start: call _ksys_cofflib_getproc mov [resize_component],eax - push fnRemoveComponent + push fnMoveComponent push [myexport] call _ksys_cofflib_getproc - mov [remove_component],eax + mov [move_component],eax push fnCraeteButton push [myexport] @@ -235,7 +235,7 @@ start: ;init bookmark mov ecx,[ColorsTable+8] - mov [Bookmark.type],byte 10000001b + mov [Bookmark.type],byte 10100001b mov [Bookmark.x],10 mov [Bookmark.y],10 mov [Bookmark.sizex],350 @@ -302,7 +302,7 @@ start: push 340;270 push 120;250 push ebx - call [remove_component] + call [move_component] ;send message 1 for redrawing ALL controls mov [Message],dword 1 @@ -540,7 +540,7 @@ text_for_text db 'Hello world from bookmark',0 fnDestroyControl db 'DestroyControl',0 fnSendMessage db 'SendMessage',0 fnResizeComponent db 'ResizeComponent',0 -fnRemoveComponent db 'RemoveComponent',0 +fnMoveComponent db 'MoveComponent',0 fnCraeteButton db 'CraeteButton',0 fnCraeteScroller db 'CraeteScroller',0 fnCraeteBookmark db 'CraeteBookmark',0 @@ -556,7 +556,7 @@ myexport dd 0 destroy_control dd 0 send_message dd 0 resize_component dd 0 -remove_component dd 0 +move_component dd 0 craete_button dd 0 craete_scroller dd 0 craete_bookmark dd 0 diff --git a/programs/develop/libGUI/examples/progress_bar/progress_bar.asm b/programs/develop/libGUI/examples/progress_bar/progress_bar.asm index fc0cb21ac..d0ce566d4 100644 --- a/programs/develop/libGUI/examples/progress_bar/progress_bar.asm +++ b/programs/develop/libGUI/examples/progress_bar/progress_bar.asm @@ -51,6 +51,11 @@ start: call _ksys_cofflib_getproc mov [send_message],eax + push fnActivateTrapForSpecializedMessage + push [myexport] + call _ksys_cofflib_getproc + mov [activate_trap_for_specialized_message],eax + push fnCraeteButton push [myexport] call _ksys_cofflib_getproc @@ -125,9 +130,11 @@ still: mov ebx,[progress] mov eax,[PointerToControlForProgressBar] - mov [eax+44],byte 1b mov [eax+44+26],ebx + push eax + call [activate_trap_for_specialized_message] + fld [progress_step] fld [progress] fadd st0,st1 @@ -139,9 +146,11 @@ still: mov [progress],0.02 mov eax,[PointerToControlForProgressBar] - mov [eax+44],byte 10000001b mov [eax+44+26],dword 0.02 + push eax + call [activate_trap_for_specialized_message] + mov [Message],dword 1 push Message push Parend @@ -345,6 +354,7 @@ fnDestroyControl db 'DestroyControl',0 fnSendMessage db 'SendMessage',0 fnCraeteButton db 'CraeteButton',0 fnCraeteProgressbar db 'CraeteProgressbar',0 +fnActivateTrapForSpecializedMessage db 'ActivateTrapForSpecializedMessage',0 myexport dd 0 @@ -354,6 +364,8 @@ craete_button dd 0 craete_progress_bar dd 0 +activate_trap_for_specialized_message dd 0 + PointerToControlForButtonExit dd 0 PointerToControlForProgressBar dd 0 diff --git a/programs/develop/libGUI/src/VERSION.INC b/programs/develop/libGUI/src/VERSION.INC index 8c1e17e42..27869e264 100644 --- a/programs/develop/libGUI/src/VERSION.INC +++ b/programs/develop/libGUI/src/VERSION.INC @@ -11,6 +11,6 @@ align 4 get_version: xor eax,eax - mov eax,dword 071014 ;07.10.13 + mov eax,dword 071119 ;07.11.19 ret \ No newline at end of file diff --git a/programs/develop/libGUI/src/activate_trap.inc b/programs/develop/libGUI/src/activate_trap.inc new file mode 100644 index 000000000..ec4a92680 --- /dev/null +++ b/programs/develop/libGUI/src/activate_trap.inc @@ -0,0 +1,16 @@ +;******************************************************* +;*Function activate a trap for the specialized message.* +;******************************************************* + +;IN +;void ActivateTrapForSpecializedMessage(dword *control) + +activate_trap_for_specialized_message: + + mov ebx,[esp+4] + xor eax,eax + mov al,[ebx+control_header_size] + or al,activate_trap + mov [ebx+control_header_size],al + + ret 4 \ No newline at end of file diff --git a/programs/develop/libGUI/src/bookmark.inc b/programs/develop/libGUI/src/bookmark.inc index 126ed9bd7..202132db4 100644 --- a/programs/develop/libGUI/src/bookmark.inc +++ b/programs/develop/libGUI/src/bookmark.inc @@ -1,6 +1,6 @@ -zk_redraw_all_Bookmark = 1000000b -zk_redraw_all_Bookmark_off = 10111111b +zk_redraw_all_Bookmark = 00100000b +zk_redraw_all_Bookmark_off = 11011111b zk_init_Bookmark = 10000000b zk_init_Bookmark_off = 01111111b zk_child_button_type = 10001001b @@ -1161,7 +1161,7 @@ SendMessageChildControlsOfBookmark: mov ebx,[eax] mov eax,ebx - + mov ebx,[Bookmark.MessageForChildButton+12] test ebx,ebx jz bookmark_left_button_of_mouse_not_pressed diff --git a/programs/develop/libGUI/src/button.inc b/programs/develop/libGUI/src/button.inc index 97493f161..38bb46bb8 100644 --- a/programs/develop/libGUI/src/button.inc +++ b/programs/develop/libGUI/src/button.inc @@ -1,16 +1,16 @@ ;button's types -bt_check_text_type = 1b -bt_check_picture_type = 10b -bt_check_picture_text_type = 100b -bt_no_draw = 1000b -bt_check_3D_type = 10000b +bt_check_text_type = 00000001b +bt_check_picture_type = 00000010b +bt_check_picture_text_type = 00000100b +bt_no_draw = 00001000b +bt_check_3D_type = 00010000b bt_check_full_redraw = 10000000b -bt_full_redraw_off = 1111111b +bt_full_redraw_off = 01111111b ;button's flags -bt_crossing = 1b -bt_crossing_pressing = 11b +bt_crossing = 00000001b +bt_crossing_pressing = 00000011b bt_crossing_pressing_off = 11111100b bt_control_data_size = 50 diff --git a/programs/develop/libGUI/src/check_box.inc b/programs/develop/libGUI/src/check_box.inc index 618c35799..1db87371a 100644 --- a/programs/develop/libGUI/src/check_box.inc +++ b/programs/develop/libGUI/src/check_box.inc @@ -136,6 +136,9 @@ check_box: no_redraw_all_check_box: + cmp [eax],dword 3 + je exit_check_box + cmp [eax],dword 6 jne no_mouse_check_box diff --git a/programs/develop/libGUI/src/edit_box.inc b/programs/develop/libGUI/src/edit_box.inc index 9908d947a..af3d0a438 100644 --- a/programs/develop/libGUI/src/edit_box.inc +++ b/programs/develop/libGUI/src/edit_box.inc @@ -182,6 +182,9 @@ edit_box: .no_keys_edit_box: + cmp [eax],dword 3 + je exit_edit_box + ;events of mouse for EditBox cmp [eax],dword 6 diff --git a/programs/develop/libGUI/src/image.inc b/programs/develop/libGUI/src/image.inc index 7c440e84c..c6b1832ff 100644 --- a/programs/develop/libGUI/src/image.inc +++ b/programs/develop/libGUI/src/image.inc @@ -2,8 +2,8 @@ im_control_data_size = 26 im_redraw_all = 10000000b im_redraw_all_off = 01111111b -im_special_redraw_on = 1b -im_special_redraw_off = 11111110b +;im_special_redraw_on = 00000001b +;im_special_redraw_off = 11111110b ;**************************************************** ;*******************craete Image********************** @@ -87,11 +87,11 @@ image: xor eax,eax mov al,[Image.type] - and al,im_special_redraw_on + and al,activate_trap test al,al jz no_activate_redraw_image - and [Image.type],im_special_redraw_off + and [Image.type],deactivate_trap or [Image.type],im_redraw_all no_activate_redraw_image: diff --git a/programs/develop/libGUI/src/libGUI.asm b/programs/develop/libGUI/src/libGUI.asm index 4e4c9cb8f..a8020191c 100644 --- a/programs/develop/libGUI/src/libGUI.asm +++ b/programs/develop/libGUI/src/libGUI.asm @@ -1,15 +1,16 @@ ;********************************************************************** ; library of Graphics Universal Interface for Kolibri operation system ; -; version 071001 +; version 071119 ; 2007 year ; ;autors: ; ;andrew_programmer polynki@mail.ru ; -;menegement of controls : destroy_control, send_message -;GUI components : button,scroller,Bookmark,text,image,number,progres bar +;menegement of controls : destroy_control, send_message,move_component +; resize_component,activate_trap_for_specialized_message +;GUI components : button,scroller,Bookmark,text,image,number,progres_bar ; ; and Maxxxx32 ; @@ -25,6 +26,9 @@ control_header_size = 44 border_width = 5 +activate_trap = 01000000b +deactivate_trap = 10111111b + section '.flat' code readable align 16 include 'macros.inc' @@ -70,8 +74,11 @@ section '.flat' code readable align 16 ;function for resize GUI component include 'resize_component.inc' - ;function for remove GUI component - include 'remove_component.inc' + ;function for move GUI component + include 'move_component.inc' + + ;function for activate trap for specialized messages + include 'activate_trap.inc' align 16 EXPORTS: @@ -79,7 +86,8 @@ EXPORTS: dd szSendMessage,send_message dd szVersion,get_version dd szResizeComponent,resize_component - dd szRemoveComponent,remove_component + dd szMoveComponent,move_component + dd szActivateTrap,activate_trap_for_specialized_message dd szcraeteButton,craete_button dd szcraeteScroller,craete_scroller dd szcraeteBookmark,craete_Bookmark @@ -95,7 +103,8 @@ szDestroyControl db 'DestroyControl',0 szSendMessage db 'SendMessage',0 szVersion db 'Version',0 szResizeComponent db 'ResizeComponent',0 -szRemoveComponent db 'RemoveComponent',0 +szMoveComponent db 'MoveComponent',0 +szActivateTrap db 'ActivateTrapForSpecializedMessage',0 szcraeteButton db 'CraeteButton',0 szcraeteScroller db 'CraeteScroller',0 szcraeteBookmark db 'CraeteBookmark',0 diff --git a/programs/develop/libGUI/src/remove_component.inc b/programs/develop/libGUI/src/move_component.inc similarity index 66% rename from programs/develop/libGUI/src/remove_component.inc rename to programs/develop/libGUI/src/move_component.inc index d25c195a5..79e3462eb 100644 --- a/programs/develop/libGUI/src/remove_component.inc +++ b/programs/develop/libGUI/src/move_component.inc @@ -1,8 +1,8 @@ ;**************************************************** -;***************Resize of GUI component************** +;*****************move of GUI component************** ;**************************************************** ;IN -;ResizeComponent(dword Parend,dword Control,dword newx,dword newy) +;MoveComponent(dword Parend,dword Control,dword newx,dword newy) ;newy ;newx ;Control @@ -12,7 +12,7 @@ align 4 -remove_component: +move_component: mov ebx,[esp+4] ;Control mov ecx,[esp+8] ;new x diff --git a/programs/develop/libGUI/src/number.inc b/programs/develop/libGUI/src/number.inc index a5254c93a..05e21cd2f 100644 --- a/programs/develop/libGUI/src/number.inc +++ b/programs/develop/libGUI/src/number.inc @@ -2,10 +2,10 @@ nm_control_data_size = 22 nm_redraw_all = 10000000b nm_redraw_off = 01111111b - nm_special_redraw_on = 100b - nm_special_redraw_off = 11111011b - nm_integer_type = 10b - nm_no_show_number = 1b + ;nm_special_redraw_on = 00000100b + ;nm_special_redraw_off = 11111011b + nm_integer_type = 00000010b + nm_no_show_number = 00000001b ;**************************************************** ;********************craete Number********************** @@ -92,12 +92,12 @@ number: xor ebx,ebx mov bl,[Number.type] - and bl,nm_special_redraw_on + and bl,activate_trap test bl,bl jz no_special_message_for_number or [Number.type],nm_redraw_all - and [Number.type],nm_special_redraw_off + and [Number.type],deactivate_trap no_special_message_for_number: diff --git a/programs/develop/libGUI/src/progress_bar.inc b/programs/develop/libGUI/src/progress_bar.inc index d468016cf..88ef34449 100644 --- a/programs/develop/libGUI/src/progress_bar.inc +++ b/programs/develop/libGUI/src/progress_bar.inc @@ -2,8 +2,8 @@ pb_control_data_size = 34 pb_redraw_all = 10000000b pb_redraw_all_off = 01111111b -pb_special_progress_on = 1b -pb_special_progress_off = 11111110b +;pb_special_progress_on = 00000001b +;pb_special_progress_off = 11111110b ;**************************************************** ;****************craete ProgressBar******************** @@ -109,7 +109,18 @@ progress_bar: cmp [eax],dword 3 jne no_special_message_progress_bar - or [ProgressBar.type],pb_special_progress_on + xor eax,eax + mov al,[ProgressBar.type] + and al,activate_trap + test al,al + jz no_draw_progress_bar + + and [ProgressBar.type],deactivate_trap + + call draw_progress + + no_draw_progress_bar: + jmp exit_progress_bar no_special_message_progress_bar: @@ -127,17 +138,6 @@ progress_bar: no_draw_all_progress_bar: - xor eax,eax - mov al,[ProgressBar.type] - and al,pb_special_progress_on - test al,al - jz no_draw_progress_bar - - and [ProgressBar.type],pb_special_progress_off - - call draw_progress - - no_draw_progress_bar: exit_progress_bar: diff --git a/programs/develop/libGUI/src/scroller.inc b/programs/develop/libGUI/src/scroller.inc index 99cb36664..a21d0761e 100644 --- a/programs/develop/libGUI/src/scroller.inc +++ b/programs/develop/libGUI/src/scroller.inc @@ -1,24 +1,25 @@ ;scroller's flags -sc_check_vertical = 1b -sc_check_horizontal = 10b -sc_check_init_child_buttons = 100b -sc_check_3D_type = 10000b -sc_scroll_bar_move = 100000b -sc_active = 1000000b +sc_check_vertical = 00000001b +sc_check_horizontal = 00000010b +sc_check_init_child_buttons = 00000100b +sc_active = 00001000b +sc_check_3D_type = 00010000b +sc_scroll_bar_move = 00100000b + sc_redraw = 10000000b sc_redraw_off = 01111111b -sc_full_redraw = 11100000b +sc_full_redraw = 10101000b sc_scroll_bar_move_off = 11011111b -sc_move_active_off = 10011111b +sc_move_active_off = 11010111b -sc_first_child_button_pressed = 1b +sc_first_child_button_pressed = 00000001b sc_first_child_button_pressed_off = 11111110b -sc_second_child_button_pressed = 10000b +sc_second_child_button_pressed = 00010000b sc_second_child_button_pressed_off = 11101111b sc_control_data_size = 29 -sc_child_button_type = 10001000b +sc_child_button_type = 10001000b ;**************************************************** ;******************Crate Scroller********************* diff --git a/programs/develop/libGUI/src/text.inc b/programs/develop/libGUI/src/text.inc index a0dd2dcf5..6e5e4d7cb 100644 --- a/programs/develop/libGUI/src/text.inc +++ b/programs/develop/libGUI/src/text.inc @@ -1,9 +1,9 @@ tx_control_data_size = 22 -tx_no_show_text = 1b +tx_no_show_text = 00000001b tx_redraw_all = 10000000b tx_redraw_all_off = 01111111b -tx_special_redraw_on = 100b +tx_special_redraw_on = 00000100b tx_special_redraw_off = 11111011b ;**************************************************** diff --git a/programs/develop/libGUI/whats new.txt b/programs/develop/libGUI/whats new.txt new file mode 100644 index 000000000..6d43d84b5 --- /dev/null +++ b/programs/develop/libGUI/whats new.txt @@ -0,0 +1,66 @@ +19.11.07 + +RUSSIAN + +Функция RemoveComponent переименована в MoveComponent. +Добавлена новая функция. +void ActivateTrapForSpecializedMessage(dword *control) - активировать ловушку для специализированных сообщений. + +ENGLISH + +Function RemoveComponent is renamed in MoveComponent. +New function is added. +void ActivateTrapForSpecializedMessage (dword *control) - to activate a trap for the specialized messages. + +15.10.07 + +RUSSIAN + +Вышла новая версия библиотеки libGUI. + +Что нового в этой версии: + +1) Передача параметров функциям библиотеки переписана на конвенцию stdcall. + +2)Теперь функции линкуются по именам. + +3)Теперь, если навести мышь на компонент и нажать левую кнопку мыши, то все сообщения от +мыши посылаются только этому компоненту.Если отпустить левую кнопку мыши, то сообщения от +мыши вновь становятся доступными для всех компонентов. + +4) В библиотеку добавлены новые функции. + int Version(void) - получить версию библиотеки. Версия возвращается в формате: год + месяц + день . Текущая + библиотека имеет версию 071014. + void RemoveComponent(void *Control,int new_x,int new_y) - перемещает компонент в новые координаты. + void ResizeComponent(void *Control,int new_sizex,int new_sizey) - изменяет размер компонента. + Примеры использования этих функций смотрите в примере Bookmark. + +5)Добавлен пример работы с libGUI в языке программирования C. Этот пример является частью интерфейса написанного + мной для моей научной программы. + +ENGLISH + +14.10.07 + +The new version of library libGUI has left. + +That new in this version: + +1) Transfer of parameters to functions of library is copied on the convention stdcall. + +2) Now functions link on names. + +3)Now, if to guide the mouse on a component and to press the left button of the mouse all +messages from the mouse are sent only to this component.If to release(let off) the left +button of the mouse messages from the mouse again become accessible to all components. + +4) In library new functions are added. + int Version (void) - to receive the version of library. The version comes back in a format: year + month + day. + The current library has version 71014. + void RemoveComponent (void *Control, int new_x, int new_y) - moves a component to new coordinates. + void ResizeComponent (void *Control, int new_sizex, int new_sizey) - changes the size of a component. + Examples of use of these functions look in example Bookmark. + +5) The example of work with libGUI in programming language C is added. This example is a part of the interface + written by me for my scientific program. +