Brunch for experiments. See readme.txt.

git-svn-id: svn://kolibrios.org@1639 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2010-10-03 17:19:43 +00:00
parent 1e30c8e1c2
commit e32fd4f0e3
11 changed files with 1386 additions and 60 deletions

View File

@ -0,0 +1,347 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@ -0,0 +1,10 @@
;include 'editbox.mac' ;macro which should make life easier :) specially for editbox
include 'checkbox.mac' ;macro implements checkbox
;include 'optionbox.mac' ;macro implements optionbox
;include 'scrollbar.mac' ;macro implements scrollbar
;include 'd_button.mac' ;macro implements dinamic_button
;include 'menubar.mac' ;macro implements menubar
;include 'filebrowser.mac' ;macro implements filebrowser
;include 'tree_list.mac' ;macro implements tree_list, image_list, list_box
;include 'pathshow.mac' ;macro implements pathshow
;include 't_edit.mac' ;macro implements text_editor

View File

@ -0,0 +1,316 @@
; Copyright (C) KolibriOS team 2004-2010. All rights reserved.
; Refer to the GNU General Public license (the "GPL") for full details.
;
;*****************************************************************************
; Box_Lib - library of graphical components
;
; Authors:
; Alexey Teplov aka <Lrz>
; Marat Zakiyanov aka Mario79, aka Mario
; Evtikhov Maxim aka Maxxxx32
; Eugene Grechnikov aka Diamond
; hidnplayr
; Igor Afanasiev aka IgorA
;*****************************************************************************
format MS COFF
public EXPORTS
section '.flat' code readable align 16
include '../../../../macros.inc'
include '../../../../proc32.inc'
include 'bl_sys.mac'
include 'box_lib.mac' ;macro which should make life easier :)
;-----------------------------------------------------------------------------
mem.alloc dd ? ;ôóíêöèÿ äëÿ âûäåëåíèÿ ïàìÿòè
mem.free dd ? ;ôóíêöèÿ äëÿ îñâîáîæäåíèÿ ïàìÿòè
mem.realloc dd ? ;ôóíêöèÿ äëÿ ïåðåðàñïðåäåëåíèÿ ïàìÿòè
dll.load dd ?
;----------------------------------------------------
;EditBox
;----------------------------------------------------
align 16
;use_editbox_draw ;macro reveals the function of the display.
align 16
;use_editbox_key ;macro reveals processing function of the keypad.
align 16
;use_editbox_mouse ;macro reveals processing function of the mouse.
;----------------------------------------------------
;CheckBox
;----------------------------------------------------
align 16
use_checkbox_draw ;macro reveals the function of the display.
align 16
use_checkbox_mouse ;macro reveals processing function of the mouse.
;--------------------------------------------------
;radiobutton Group
;--------------------------------------------------
align 16
;use_optionbox_driver ;macro that control the operating modes
align 16
;use_optionbox_draw ;macro reveals the function of the display.
align 16
;use_optionbox_mouse ;macro reveals processing function of the mouse.
;--------------------------------------------------
;scrollbar Group
;--------------------------------------------------
align 16
;use_scroll_bar
align 16
;use_scroll_bar_vertical
align 16
;use_scroll_bar_horizontal
;--------------------------------------------------
;dinamic button Group
;--------------------------------------------------
align 16
;use_dinamic_button
;--------------------------------------------------
;menubar Group
;--------------------------------------------------
align 16
;use_menu_bar
;--------------------------------------------------
;filebrowser Group
;--------------------------------------------------
align 16
;use_file_browser
;--------------------------------------------------
;tree list
;--------------------------------------------------
align 16
;use_tree_list
;--------------------------------------------------
;PathShow Group
;--------------------------------------------------
align 16
;use_path_show
;--------------------------------------------------
;text editor
;--------------------------------------------------
align 16
;use_text_edit
;input:
; eax = óêàçàòåëü íà ôóíêöèþ âûäåëåíèÿ ïàìÿòè
; ebx = ... îñâîáîæäåíèÿ ïàìÿòè
; ecx = ... ïåðåðàñïðåäåëåíèÿ ïàìÿòè
; edx = ... çàãðóçêè áèáëèîòåêè (ïîêà íå èñïîëüçóåòñÿ)
align 16
lib_init:
mov [mem.alloc], eax
mov [mem.free], ebx
mov [mem.realloc], ecx
mov [dll.load], edx
ret
align 16
EXPORTS:
dd sz_init, lib_init
dd sz_version, 0x00000001
;dd sz_edit_box, edit_box
;dd sz_edit_box_key, edit_box_key
;dd sz_edit_box_mouse, edit_box_mouse
;dd sz_edit_box_set_text, edit_box_set_text
;dd szVersion_ed, 0x00000001
dd sz_check_box_draw, check_box_draw
dd sz_check_box_mouse, check_box_mouse
dd szVersion_ch, 0x00000001
;dd sz_option_box_draw, option_box_draw
;dd sz_option_box_mouse, option_box_mouse
;dd szVersion_op, 0x00000001
;dd sz_Scrollbar_ver_draw, scroll_bar_vertical.draw
;dd sz_Scrollbar_ver_mouse, scroll_bar_vertical.mouse
;dd sz_Scrollbar_hor_draw, scroll_bar_horizontal.draw
;dd sz_Scrollbar_hor_mouse, scroll_bar_horizontal.mouse
;dd szVersion_scrollbar, 0x00010001
;dd sz_Dbutton_draw, dinamic_button.draw
;dd sz_Dbutton_mouse, dinamic_button.mouse
;dd szVersion_dbutton, 0x00010001
;dd sz_Menu_bar_draw, menu_bar.draw
;dd sz_Menu_bar_mouse, menu_bar.mouse
;dd sz_Menu_bar_activate, menu_bar.activate
;dd szVersion_menu_bar, 0x00010002
;dd sz_FileBrowser_draw, fb_draw_panel
;dd sz_FileBrowser_mouse, fb_mouse
;dd sz_FileBrowser_key, fb_key
;dd szVersion_FileBrowser, 0x00010001
;dd sz_tl_data_init, tl_data_init
;dd sz_tl_data_clear, tl_data_clear
;dd sz_tl_info_clear, tl_info_clear
;dd sz_tl_key, tl_key
;dd sz_tl_mouse, tl_mouse
;dd sz_tl_draw, tl_draw
;dd sz_tl_info_undo, tl_info_undo
;dd sz_tl_info_redo, tl_info_redo
;dd sz_tl_node_add, tl_node_add
;dd sz_tl_node_set_data, tl_node_set_data
;dd sz_tl_node_get_data, tl_node_get_data
;dd sz_tl_node_delete, tl_node_delete
;dd sz_tl_cur_beg, tl_cur_beg
;dd sz_tl_cur_next, tl_cur_next
;dd sz_tl_cur_perv, tl_cur_perv
;dd sz_tl_node_close_open, tl_node_close_open
;dd sz_tl_node_lev_inc, tl_node_lev_inc
;dd sz_tl_node_lev_dec, tl_node_lev_dec
;dd sz_tl_node_move_up, tl_node_move_up
;dd sz_tl_node_move_down, tl_node_move_down
;dd sz_tl_node_poi_get_info, tl_node_poi_get_info
;dd sz_tl_node_poi_get_next_info, tl_node_poi_get_next_info
;dd sz_tl_node_poi_get_data, tl_node_poi_get_data
;dd sz_tl_save_mem, tl_save_mem
;dd sz_tl_load_mem, tl_load_mem
;dd sz_tl_get_mem_size, tl_get_mem_size
;dd sz_tl_version_tree_list, 0x00000001
;dd sz_PathShow_prepare, path_show.prepare
;dd sz_PathShow_draw, path_show.draw
;dd szVersion_path_show, 0x00010001
;dd sz_ted_but_save_file, ted_but_save_file
;dd sz_ted_but_sumb_upper, ted_but_sumb_upper
;dd sz_ted_but_sumb_lover, ted_but_sumb_lover
;dd sz_ted_can_save, ted_can_save
;dd sz_ted_clear, ted_clear
;dd sz_ted_delete, ted_delete
;dd sz_ted_draw, ted_draw
;dd sz_ted_init, ted_init
;dd sz_ted_init_scroll_bars, ted_init_scroll_bars
;dd sz_ted_init_syntax_file, ted_init_syntax_file
;dd sz_ted_is_select, ted_is_select
;dd sz_ted_key, ted_key
;dd sz_ted_mouse, ted_mouse
;dd sz_ted_open_file, ted_open_file
;dd sz_ted_text_add, ted_text_add
;dd sz_ted_but_select_word, ted_but_select_word
;dd sz_ted_but_cut, ted_but_cut
;dd sz_ted_but_copy, ted_but_copy
;dd sz_ted_but_paste, ted_but_paste
;dd sz_ted_but_undo, ted_but_undo
;dd sz_ted_but_redo, ted_but_redo
;dd sz_ted_but_reverse, ted_but_reverse
;dd sz_ted_but_find_next, ted_but_find_next
;dd sz_ted_text_colored, ted_text_colored
;dd sz_ted_version, 0x00000002
dd 0,0
sz_init db 'lib_init',0
sz_version db 'version',0
sz_edit_box db 'edit_box',0
sz_edit_box_key db 'edit_box_key',0
sz_edit_box_mouse db 'edit_box_mouse',0
sz_edit_box_set_text db 'edit_box_set_text',0
szVersion_ed db 'version_ed',0
sz_check_box_draw db 'check_box_draw',0
sz_check_box_mouse db 'check_box_mouse',0
szVersion_ch db 'version_ch',0
sz_option_box_draw db 'option_box_draw',0
sz_option_box_mouse db 'option_box_mouse',0
szVersion_op db 'version_op',0
sz_Scrollbar_ver_draw db 'scrollbar_v_draw',0
sz_Scrollbar_ver_mouse db 'scrollbar_v_mouse',0
sz_Scrollbar_hor_draw db 'scrollbar_h_draw',0
sz_Scrollbar_hor_mouse db 'scrollbar_h_mouse',0
szVersion_scrollbar db 'version_scrollbar',0
sz_Dbutton_draw db 'dbutton_draw',0
sz_Dbutton_mouse db 'dbutton_mouse',0
szVersion_dbutton db 'version_dbutton',0
sz_Menu_bar_draw db 'menu_bar_draw',0
sz_Menu_bar_mouse db 'menu_bar_mouse',0
sz_Menu_bar_activate db 'menu_bar_activate',0
szVersion_menu_bar db 'version_menu_bar',0
sz_FileBrowser_draw db 'FileBrowser_draw',0
sz_FileBrowser_mouse db 'FileBrowser_mouse',0
sz_FileBrowser_key db 'FileBrowser_key',0
szVersion_FileBrowser db 'version_FileBrowser',0
sz_tl_data_init db 'tl_data_init',0
sz_tl_data_clear db 'tl_data_clear',0
sz_tl_info_clear db 'tl_info_clear',0
sz_tl_key db 'tl_key',0
sz_tl_mouse db 'tl_mouse',0
sz_tl_draw db 'tl_draw',0
sz_tl_info_undo db 'tl_info_undo',0
sz_tl_info_redo db 'tl_info_redo',0
sz_tl_node_add db 'tl_node_add',0
sz_tl_node_set_data db 'tl_node_set_data',0
sz_tl_node_get_data db 'tl_node_get_data',0
sz_tl_node_delete db 'tl_node_delete',0
sz_tl_cur_beg db 'tl_cur_beg',0
sz_tl_cur_next db 'tl_cur_next',0
sz_tl_cur_perv db 'tl_cur_perv',0
sz_tl_node_close_open db 'tl_node_close_open',0
sz_tl_node_lev_inc db 'tl_node_lev_inc',0
sz_tl_node_lev_dec db 'tl_node_lev_dec',0
sz_tl_node_move_up db 'tl_node_move_up',0
sz_tl_node_move_down db 'tl_node_move_down',0
sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0
sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0
sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0
sz_tl_save_mem db 'tl_save_mem',0
sz_tl_load_mem db 'tl_load_mem',0
sz_tl_get_mem_size db 'tl_get_mem_size',0
sz_tl_version_tree_list db 'version_tree_list',0
sz_PathShow_prepare db 'PathShow_prepare',0
sz_PathShow_draw db 'PathShow_draw',0
szVersion_path_show db 'version_PathShow',0
sz_ted_but_save_file db 'ted_but_save_file',0
sz_ted_but_sumb_upper db 'ted_but_sumb_upper',0
sz_ted_but_sumb_lover db 'ted_but_sumb_lover',0
sz_ted_can_save db 'ted_can_save',0
sz_ted_clear db 'ted_clear',0
sz_ted_delete db 'ted_delete',0
sz_ted_draw db 'ted_draw',0
sz_ted_init db 'ted_init',0
sz_ted_init_scroll_bars db 'ted_init_scroll_bars',0
sz_ted_init_syntax_file db 'ted_init_syntax_file',0
sz_ted_is_select db 'ted_is_select',0
sz_ted_key db 'ted_key',0
sz_ted_mouse db 'ted_mouse',0
sz_ted_open_file db 'ted_open_file',0
sz_ted_text_add db 'ted_text_add',0
sz_ted_but_select_word db 'ted_but_select_word',0
sz_ted_but_cut db 'ted_but_cut',0
sz_ted_but_copy db 'ted_but_copy',0
sz_ted_but_paste db 'ted_but_paste',0
sz_ted_but_undo db 'ted_but_undo',0
sz_ted_but_redo db 'ted_but_redo',0
sz_ted_but_reverse db 'ted_but_reverse',0
sz_ted_but_find_next db 'ted_but_find_next',0
sz_ted_text_colored db 'ted_text_colored',0
sz_ted_version db 'version_text_edit',0

View File

@ -0,0 +1,361 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use EditBox ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ed_width equ [edi] ;øèðèíà êîìïîíåíòà
ed_left equ [edi+4] ;ïîëîæåíèå ïî îñè õ
ed_top equ [edi+8] ;ïîëîæåíèå ïî îñè ó
ed_color equ [edi+12] ;öâåò ôîíà êîìïîíåíòà
shift_color equ [edi+16] ;=0x6a9480 äëÿ ïðèìåðà âîçüåì æåëåíûé öâåò áîêñà
ed_focus_border_color equ [edi+20] ;öâåò ðàìêè êîìïîíåíòà
ed_blur_border_color equ [edi+24] ;öâåò íå àêòèâíîãî êîìïîíåíòà
ed_text_color equ [edi+28] ;öâåò òåêñòà
ed_max equ [edi+32] ;êîë-âî ñèìâîëîâ êîòîðûå ìîæíî ìàêñèìàëüíî ââåñòè
ed_text equ [edi+36] ;óêàçàòåëü íà áóôåð
ed_mouse_variable equ [edi+40] ; óêàçàòåëü íà ïåðåìåííóþ äëÿ áîêñà/ãðóïïû
ed_flags equ [edi+44] ;ôëàãè
bp_flags equ [ebp+44] ;â íåêîòîðûõ ïðîöåäóðàõ edi èñïîëüçóåòñÿ, âçàìåí óêàçàòåëü õðàíèòüñÿ â ebp
ed_size equ [edi+48] ;êîë-âî ñèìâîëîâ
bp_size equ [ebp+48] ;êîë-âî ñèìâïîëîâ, äëÿ àäðåñàöèè èñïëüçóåòñÿ ebpá edi çàíÿò
ed_pos equ [edi+52] ;ïîçèöèÿ êóðñîðà
ed_offset equ [edi+56] ;ñìåùåíèå
cl_curs_x equ [edi+60] ;ïðåäûäóùåå êîîðäèíàòà êóðñîðà ïî õ
cl_curs_y equ [edi+64] ;ïðåäûäóùåå êîîðäèíàòà êóðñîðà ïî ó
ed_shift_pos equ [edi+68] ;ïîëîæåíèå êóðñîðà
ed_shift_pos_old equ [edi+72] ;ñòàðîå ïîëîæåíèå êóðñîðà
ed_struc_size=76
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Bit mask from editbox
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ed_figure_only= 1000000000000000b ;îäíè ñèìâîëû
ed_always_focus= 100000000000000b
ed_focus= 10b ;ôîêóñ ïðèëîæåíèÿ
ed_shift_on= 1000b ;åñëè íå óñòàíîâëåí -çíà÷èò âïåðâûå íàæàò shift,åñëè áûë óñòàíîâëåí, çíà÷èò ìû óæå ÷òî - òî äåëàëè óäåðæèâàÿ shift
ed_shift_on_off=1111111111110111b
ed_shift= 100b ;âêëþ÷àåòñÿ ïðè íàæàòèè íà shift ò.å. åñëè íàæèìàþ
ed_shift_off= 1111111111111011b
ed_shift_bac= 10000b ;áèò äëÿ î÷èñòêè âûäåëåíîãî shift ò.å. ïðè óñòàíîâêå ãîâîðèò ÷òî åñòü âûäåëåíèå
ed_shift_bac_cl=1111111111101111b ;î÷èñòêà ïðè óäàëåíèè âûäåëåíèÿ
ed_shift_cl= 1111111111100011b
ed_shift_mcl= 1111111111111011b
ed_left_fl= 100000b
ed_right_fl= 1111111111011111b
ed_offset_fl= 1000000b
ed_offset_cl= 1111111110111111b
ed_insert= 10000000b
ed_insert_cl= 1111111101111111b
ed_mouse_on = 100000000b
ed_mous_adn_b= 100011000b
ed_mouse_on_off=1111111011111111b
ed_height=14 ; âûñîòà
struc edit_box width,left,top,color,shift_color,focus_border_color,\
blur_border_color,text_color,max,text,mouse_variable,flags,size,pos
{
.width dd width
.left dd left
.top dd top
.color dd color
.shift_color dd shift_color
.focus_border_color dd focus_border_color
.blur_border_color dd blur_border_color
.text_color dd text_color
.max dd max
.text dd text
.mouse_variable dd mouse_variable
.flags dd flags+0
.size dd size+0
.pos dd pos+0
.offset dd 0
.cl_curs_x dd 0
.cl_curs_y dd 0
.shift dd 0
.shift_old dd 0
}
macro edit_boxes_set_sys_color start,end,color_table
{
mov edi,start
mov ecx,((end-start)/ed_struc_size)
mov esi,color_table
@@:
mov eax,dword [esi+36]
mov ebx,dword [esi+20]
push dword eax
pop dword ed_focus_border_color
shr bh,1
shr bl,1
shr ah,1
shr al,1
add ah,bh
add al,bl
ror eax,16
ror ebx,16
shr bl,1
shr al,1
add al,bl
ror eax,16
mov dword ed_blur_border_color,eax
mov dword shift_color,eax
add edi,ed_struc_size
loop @b
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use CheckBox ;
;Last change 03.10.2010
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ch_struc_size=36 ;ðàçìåð ñòðóêòóðû
ch_flag_en=10b ;ôëàã óñòàíîâëåííîãî ÷åê áîêñà.
ch_left_s equ [ebp] ;êîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî õ
ch_top_s equ [ebp+4] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî ó
ch_text_margin equ [ebp+8] ;=4 ðàññòîÿíèå îò ïðÿìîóãîëüíèêà ÷åê áîêñà äî íàäïèñè
ch_color equ [ebp+12] ;öâåò âíóòðè checkbox
ch_border_color equ [ebp+16] ; or [edi+4] ;öâåò ðàìêè checkbox åå ìîæíî çàäàòü ñàìîñòîÿòåëüíî
ch_text_color equ [ebp+20] ;[edi+4] ;öâåò òåêñòà
ch_text_ptr equ [ebp+24] ;óêàçàòåëü íà íà÷àëî òåêñòîâîé ñòðîêè
ch_text_length equ [ebp+28] ;äëèííà ñòðîêè
ch_flags equ [ebp+32] ;ôëàãè
struc check_box left_s,top_s,ch_text_margin,color,border_color,text_color,text,ch_text_length,flags
{ ;ñòðóêòóðà ïàðàìåòðîâ äëÿ ÷åê áîêñà
.left_s: dd left_s ;+0 ïîëîæåíèå ïî õ dw + ðàçìåð dw
.top_s: dd top_s ;+4 ïîëîæåíèå ïî ó dw + ðàçìåð dw
.ch_text_margin: dd ch_text_margin ;ðàññòîÿíèå îò ïðÿìîóãîëüíèêà ÷åê áîêñà äî íàäïèñè
.color: dd color ;öâåò âíóòðè ÷åêáîêñà
.border_color: dd border_color ;öâåò ðàìêè
.text_color: dd text_color ;öâåò íàäïèñè
.text: dd text ;àäðåñ â êîäå ïðîãðàììû ãäå ðàñïîëîæåí òåêñò
.ch_text_length: dd ch_text_length ;äëèííà ñòðîêè ñ ñèìâîëàìè
.flags: dd flags+0 ; ôëàãè
}
macro check_boxes_set_sys_color start,end,color_table
{
mov ebp,start
mov ecx,((end-start)/ch_struc_size)
mov esi,color_table
@@:
push dword [esi+32] ;öâåò òåêñòà â ðàáî÷åé îáëàñòè îêíà
pop dword ch_text_color
push dword [esi+36] ;öâåò ãðàôèêè â îêíå (ðàçäåëèòåëüíûå ëèíèè è ò.ï.)
pop dword ch_border_color
add ebp,ch_struc_size
loop @b
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use OptionBox ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
struc option_box point_gr,left,top,op_text_margin,op_size,color,border_color,text_color,text,op_text_length,flags
{ ;ñòðóêòóðà ïàðàìåòðîâ äëÿ ÷åê áîêñà
op_flag_en=10b
.option_group: dd point_gr
.left: dw left ;+0 ;ïîëîæåíèå ïî õ
.top: dw top ;ïîëîæåíèå ïî ó
.ch_text_margin: dd op_text_margin ;ðàññòîÿíèå îò ïðÿìîóãîëüíèêà ÷åê áîêñà äî íàäïèñè
.ch_size: dd op_size ;ðàçìåð êâàäðàòà ÷åê áîêñà, äëÿ ïðèìåðà 12
.color: dd color ;öâåò âíóòðè ÷åêáîêñà
.border_color: dd border_color ;öâåò ðàìêè
.text_color: dd text_color ;öâåò íàäïèñè
.text: dd text ;àäðåñ â êîäå ïðîãðàììû ãäå ðàñïîëîæåí òåêñò
.ch_text_length: dd op_text_length ;äëèííà ñòðîêè ñ ñèìâîëàìè
.flags: dd flags+0 ; ôëàãè
}
option_group equ [edi]
op_left equ [edi+4] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî õ
op_top equ [edi+6] ;êîîðäèíàòà íà÷àëà ðèñîâàíèÿ ïî ó
op_text_margin equ [edi+8] ;=4 ðàññòîÿíèå îò ïðÿìîóãîëüíèêà ÷åê áîêñà äî íàäïèñè
op_size equ [edi+12] ;12 ðàçìåð êâàäðàòà ÷åê áîêñà
op_color equ [edi+16]
op_border_color equ [edi+20] ; or [edi+4] ;öâåò ðàìêè checkbox åå ìîæíî çàäàòü ñàìîñòîÿòåëüíî
op_text_color equ [edi+24];[edi+4] ;öâåò òåêñòà
op_text_ptr equ [edi+28] ;óêàçàòåëü íà íà÷àëî òåêñòîâîé ñòðîêè
op_text_length equ [edi+32]
op_flags equ [edi+36] ;ôëàãè
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use TreeList ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
struc tree_list info_size,info_max_count,style, img_cx,img_cy,\
col_bkg,col_zag,col_txt, box_l,box_t,box_w,box_h, capt_cy,info_capt_offs,\
info_capt_len,el_focus, p_scrol,on_press {
.data_info dd 0
.info_size dw info_size
.info_max_count dd info_max_count
.style dd style
.data_nodes dd 0
.data_img dd 0
.img_cx dw img_cx
.img_cy dw img_cy
.data_img_sys dd 0
.ch_tim dd 0
.ls_tim dd 0
.tim_undo dd 0
.cur_pos dd 0
.col_bkg dd col_bkg
.col_zag dd col_zag
.col_txt dd col_txt
.box_left dd box_l
.box_top dd box_t
.box_width dd box_w
.box_height dd box_h
.capt_cy dw capt_cy
.info_capt_offs dw info_capt_offs
.info_capt_len dw info_capt_len
.el_focus dd el_focus
.p_scrol dd p_scrol
rb 4
.on_activate dd 0
.on_press dd on_press
}
tl_info_size equ word[edi +4] ;ðàçìåð äàííûõ âûäåëÿåìûõ äëÿ êàæäîãî óçëà (ïîëüçîâàòåëüñüêèå äàííûå + òåêñò äëÿ ïîäïèñè)
tl_info_max_count equ dword[edi+6] ;ìàêñèìàëüíîå êîëè÷åñòâî óçëîâ, êîòîðûå ìîæíî äîáàâèòü â ýëåìåíò
tl_style equ dword[edi+10] ;ñòèëè ýëåìåíòà
tl_data_nodes equ dword[edi+14] ;óêàçàòåëü íà ñòðóêòóðû óçëîâ
tl_data_img equ dword[edi+18] ;óêàçàòåëü íà èçîáðàæåíèÿ ñ èêîíêàìè óçëîâ
tl_img_cx equ word[edi+22] ;øèðèíà èêîíîê
tl_img_cy equ word[edi+24] ;âûñîòà èêîíîê
tl_data_img_sys equ dword[edi+26] ;óêàçàòåëü íà ñèñòåìíûå èçîáðàæåíèÿ (ñòðåëêè, ïëþñèêè)
tl_ch_tim equ dword[edi+30] ;êîëè÷åñòâî èçìåíåíèé â ôàéëå
tl_tim_undo equ dword[edi+38] ;êîëè÷åñòâî îòìåíåííûõ äåéñòâèé
tl_cur_pos equ dword[edi+42] ;ïîçèöèÿ êóðñîðà
tl_col_bkg equ dword[edi+46] ;öâåò ôîíà
tl_col_zag equ dword[edi+50] ;öâåò çàãîëîâêà
tl_col_txt equ dword[edi+54] ;öâåò òåêñòà
tl_box_left equ dword[edi+58]
tl_box_top equ dword[edi+62]
tl_box_width equ dword[edi+66]
tl_box_height equ dword[edi+70]
tl_capt_cy equ word[edi+74] ;âûñîòà ïîäïèñè
tl_info_capt_offs equ word[edi+76] ;ñäâèã äëÿ íà÷àëà òåêñòà (ïîäïèñè óçëà)
tl_info_capt_len equ word[edi+78] ;äëèííà òåêñòà ïîäïèñè óçëà (åñëè = 0 òî äî êîíöà ñòðóêòóðû)
tl_el_focus equ dword[edi+80] ;óêàçàòåëü íà ñòðóêòóðó ýëåìåíòà â ôîêóñå
tl_p_scrol equ dword[edi+84] ;óêàçàòåëü íà ñòðóêòóðó ñêðîëëèíãà
tl_on_press equ dword[edi+96] ;óêàçàòåëü íà ôóíêöèþ, êîòîðàÿ âûçûâàåòñÿ ïðè íàæàòèè Enter
;data_info dd ? ;+ 0 óêàçàòåëü íà îñíîâíûå äàíûå
;ls_tim dd ? ;+34 âðåìÿ ïîñëåäíåãî ñîõðàíåíèÿ
;on_activate dd ? ;+92 óêàçàòåëü íà ôóíêöèþ ïðè àêòèâèðîâàíèè óçëà
;êîíñòàíòû ñòèëÿ
tl_key_no_edit equ 1b ;ýëåìåíò íåëüçÿ ðåäàêòèðîâàòü íà êëàâèàòóðå (èçìåíÿòü óðîâíè, óäàëÿòü)
tl_draw_par_line equ 10b ;ðèñîâàòü ëèíèè ê ðîäèòåëüñêîìó óçëó
tl_list_box_mode equ 100b ;ñòèëü íå îòîáðàæàåò óðîâíè (êàê â ListBox âñå îäíîãî óðîâíÿ)
;êîíñòàíòû äëÿ ôóíêöèé
tl_err_save_memory_size equ 10b ;íå õâàòàåò ïàìÿòè äëÿ ñîõðàíåíèÿ ýëåìåíòà
tl_err_load_caption equ 1b ;â ïàìÿòè íåò çàãîëîâêà 'tree'
tl_err_load_info_size equ 100b ;íå ñîâïàäàåò ðàçìåð èíôîðìàöèîííîé ñòðóêòóðû ïðè îòêðûòèè
tl_load_mode_add equ 0x20000 ;îïöèÿ ñ÷èòûâàíèÿ â ðåæèìå äîáàâëåíèÿ èíôîðìàöèè
tl_save_load_heder_size equ 26 ;ðàçìåð çàãîëîâêà äëÿ çàïèñè/÷òåíèÿ ýëåìåíòîâ
tl_offs_box equ 58 ;íà÷àëî BOX ñòðóêòóðû äëÿ tree_list
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use TextEditor ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ted_wnd_l equ dword[edi+ 0] ;îêíî ðåäàêòîðà: îòñòóï ñëåâà
ted_wnd_t equ dword[edi+ 4] ;îêíî ðåäàêòîðà: îòñòóï ñâåðõó
ted_wnd_w equ dword[edi+ 8] ;îêíî ðåäàêòîðà: øèðèíà
ted_wnd_h equ dword[edi+12] ;îêíî ðåäàêòîðà: âûñîòà
ted_rec_l equ dword[edi+16] ;øèðèíà ïàíåëè â îêíå
ted_rec_t equ dword[edi+20] ;âûñîòà ïàíåëè â îêíå
ted_rec_w equ dword[edi+24] ;øèðèíà ñèìâîëà (çíàêîìåñòà) â îêíå
ted_rec_h equ dword[edi+28] ;âûñîòà ñèìâîëà (çíàêîìåñòà) â îêíå
ted_drag_m equ byte[edi+32] ;âûäåëåíèå îò ìûøè
ted_drag_k equ byte[edi+33] ;âûäåëåíèå îò êëàâèàòóðû
ted_sel_x0 equ dword[edi+34] ;êîîðäèíàòà âûäåëåíèÿ x0
ted_sel_y0 equ dword[edi+38] ;êîîðäèíàòà âûäåëåíèÿ y0
ted_sel_x1 equ dword[edi+42] ;êîîðäèíàòà âûäåëåíèÿ x1
ted_sel_y1 equ dword[edi+46] ;êîîðäèíàòà âûäåëåíèÿ y1
;çàïàñíûå êîîðäèíàòû âûäåëåíèÿ
ted_seln_x0 equ dword[edi+50]
ted_seln_y0 equ dword[edi+54]
ted_seln_x1 equ dword[edi+58]
ted_seln_y1 equ dword[edi+62]
ted_tex equ dword[edi+66] ;óêàçàòåëü íà ïàìÿòü äëÿ õðàíåíèÿ òåêñòà
ted_tex_1 equ dword[edi+70] ;óêàçàòåëü íà 1-þ ñòðêóòðó ñèìâîëà
ted_tex_end equ dword[edi+74] ;óêàçàòåëü íà ïîñëåäíþþ ñòðóêòóðó ñèìâîëà
ted_cur_x equ dword[edi+78] ;êîîðäèíàòà x êóðñîðà
ted_cur_y equ dword[edi+82] ;êîîðäèíàòà y êóðñîðà
ted_max_chars equ dword[edi+86] ;ìàêñèìàëüíîå ÷èñëî ñèìâîëîâ â îäíîì äîêóìåíòå
ted_colors_text_count equ dword[edi+90] ;êîëëè÷åñòâî öâåòîâ òåêñòà
ted_key_words_count equ dword[edi+94] ;êîëëè÷åñòâî êëþ÷åâûõ ñëîâ
ted_color_cursor equ dword[edi+98] ;öâåò êóðñîðà
ted_color_wnd_capt equ dword[edi+102] ;öâåò ïîëåé âîêðóã îêíà
ted_color_wnd_work equ dword[edi+106] ;öâåò ôîíà îêíà
ted_color_wnd_bord equ dword[edi+110] ;öâåò òåêñòà íà ïîëÿõ
ted_color_select equ dword[edi+114] ;öâåò âûäåëåíèÿ
ted_color_cur_text equ dword[edi+118] ;öâåò ñèìâîëà ïîä êóðñîðîì
ted_color_wnd_text equ dword[edi+122] ;öâåò òåêñòà â îêíå
ted_syntax_file equ dword[edi+126] ;óêàçàòåëü íà íà÷àëî ôàéëà ñèíòàêñèñà
ted_syntax_file_size equ dword[edi+130] ;ìàêñèìàëüíûé ðàçìåð ôàéëà ñèíòàêñèñà
ted_text_colors equ dword[edi+134] ;óêàçàòåëü íà ìàññèâ öâåòîâ òåêñòà
ted_help_text_f1 equ dword[edi+138] ;óêàçàòåëü íà òåêñò ñïðàâêè (ïî íàæàòèè F1)
ted_help_id equ dword[edi+142] ;èäåíòèôèêàòîð äëÿ ñïðàâêè
ted_key_words_data equ dword[edi+146] ;óêàçàòåëü íà ñòðóêòóðû êëþ÷åâûõ ñëîâ TexColViv
ted_tim_ch equ dword[edi+150] ;êîëëè÷åñòâî èçìåíåíèé â ôàéëå
ted_tim_undo equ dword[edi+154] ;êîëëè÷åñòâî îòìåíåííûõ äåéñòâèé
ted_tim_ls equ dword[edi+158] ;âðåìÿ ïîñëåäíåãî ñîõðàíåíèÿ
ted_tim_co equ dword[edi+162] ;âðåìÿ ïîñëåäíåé öâåòîâîé ðàçìåòêè
ted_el_focus equ dword[edi+166] ;óêàçàòåëü íà ïåðåìåííóþ ýëåìåíòà â ôîêóñå
ted_err_save equ byte[edi+170] ;îøèáêà ñîõðàíåíèÿ ôàéëà
ted_panel_id equ byte[edi+171] ;íîìåð îòêðûòîé ïàíåëè
ted_key_new equ byte[edi+172] ;ñèìâîë, êîòîðûé áóäåò äîáàâëÿòñÿ ñ êëàâèàòóðû
ted_symbol_new_line equ byte[edi+173] ;ñèìâîë çàâåðøåíèÿ ñòðîêè
ted_scr_w equ dword[edi+174] ;âåðòèêàëüíûé ñêðîëëèíã
ted_scr_h equ dword[edi+178] ;ãîðèçîíòàëüíûé ñêðîëëèíã
ted_arr_key_pos equ dword[edi+182] ;óêàçàòåëü íà ìàññèâ ïîçèöèé êëþ÷åâûõ ñëîâ
ted_buffer equ dword[edi+186] ;óêàçàòåëü íà áóôåð êîïèðîâàíèÿ/âñòàâêè
ted_buffer_find equ dword[edi+190] ;óêàçàòåëü íà áóôåð äëÿ ïîèñêà
ted_cur_ins equ byte[edi+194] ;ðåæèì ðàáîòû êóðñîðà (îáû÷íûé èëè çàìåíà)
ted_mode_color equ byte[edi+195] ;ðåæèì âûäåëåíèÿ ñëîâ öâåòîì (0-âûêë. 1-âêë.)
ted_mode_invis equ byte[edi+196] ;ðåæèì ïîêàçà íåïå÷àòàåìûõ ñèìâîëîâ
ted_gp_opt equ byte[edi+197] ;îïöèè âîçâðàùàåìûå ôóíêöèåé ted_get_pos_by_cursor
ted_fun_on_key_ctrl_o equ dword[edi+198] ;óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ ïðè íàæàòèè Ctrl+O (îòêðûòèå ôàéëà)
ted_fun_on_key_ctrl_f equ dword[edi+202] ;... Ctrl+F (âûçîâà/ñêðûòèÿ ïàíåëè ïîèñêà)
ted_fun_on_key_ctrl_n equ dword[edi+206] ;... Ctrl+N (ñîçäàíèå íîâîãî äîêóìåíòà)
ted_fun_on_key_ctrl_s equ dword[edi+210] ;... Ctrl+S
ted_buffer_size equ dword[edi+214] ;ðàçìåð áóôåðà êîïèðîâàíèÿ/âñòàâêè
ted_fun_find_err equ dword[edi+218] ;óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ åñëè ïîèñê çàêîí÷èëñÿ íåóäà÷íî
ted_fun_init_synt_err equ dword[edi+222] ;óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ ïðè îøèáî÷íîì îòêðûòèè ôàéëà ñèíòàêñèñà
ted_fun_draw_panel_buttons equ dword[edi+226] ;óêàçàòåëü íà ôóíêöèþ ðèñîâàíèÿ ïàíåëè ñ êíîïêàìè
ted_fun_draw_panel_find equ dword[edi+230] ;óêàçàòåëü íà ôóíêöèþ ðèñîâàíèÿ ïàíåëè ïîèñêà
ted_fun_draw_panel_syntax equ dword[edi+234] ;óêàçàòåëü íà ôóíêöèþ ðèñîâàíèÿ ïàíåëè ñèíòàêñèñà
ted_fun_save_err equ dword[edi+238] ;óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ åñëè ñîõðàíåíèå ôàéëà çàêîí÷èëîñü íåóäà÷íî
ted_increase_size equ dword[edi+242] ;÷èñëî ñèìâîëîâ íà êîòîðûå áóäåò óâå÷èâàòüñÿ ïàìÿòü ïðè íåõâàòêå
ted_ptr_free_symb equ dword[edi+246] ;óêàçàòåëü íà ñâîáîäíóþ ïàìÿòü, â êîòîðóþ ìîæíî äîáàâëÿòü ñèìâîë (èñïîëüçóåòñÿ âíóòðè ýëåìåíòà äëÿ óñêîðåíèÿ âñòàâêè òåêñòà)
;------------------------------------------------------------------------------
ted_opt_ed_move_cursor equ 1 ;äâèãàòü êóðñîð ïîñëå äîáàâëåíèÿ òåêñòà
ted_opt_ed_change_time equ 2 ;äîáàâëÿòü èçìåíåíèÿ ïðè ðåäàêòèðîâàíèè òåêñòà
ted_offs_sel equ 34 ;ñìåùåíèå ñòðóêòóðû sel
ted_offs_seln equ 50 ;ñìåùåíèå ñòðóêòóðû seln
ted_offs_count_colors equ 90 ;ñìåùåíèå ïåðåìåííîé êîëëè÷åñòâà öâåòîâ
ted_offs_key_new equ 172
ted_offs_symbol_new_line equ 173 ;ñìåùåíèå ñèìâîëà íîâîé ñòðîêè
;------------------------------------------------------------------------------
; *** scroll bar constant ***
sb_offs_size_x equ 0
sb_offs_start_x equ 2
sb_offs_size_y equ 4
sb_offs_start_y equ 6
sb_offs_max_area equ 16
sb_offs_cur_area equ 20
sb_offs_position equ 24
sb_offs_bckg_col equ 28
sb_offs_frnt_col equ 32
sb_offs_line_col equ 36
sb_offs_redraw equ 40
sb_offs_delta2 equ 46
sb_offs_all_redraw equ 80
;------------------------------------------------------------------------------

View File

@ -0,0 +1,147 @@
;*****************************************************************************
; Example for Box_lib: checkbox
; Copyright (c) 2007-2010, Alexey Teplov aka <Lrz>
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;******************************************************************************
use32
org 0x0
;------------ <head> from kolibrios programm
db 'MENUET01'
dd 0x01
dd START
dd MEM_END
dd PRIL_END
dd PRIL_END
dd 0x0
dd cur_dir_path
;------------ </head>
;------------ <include macros>
include '../../../../macros.inc'
include '../load_lib.mac'
include 'box_lib.mac'
;include 'macros.inc'
;include 'load_lib.mac'
;------------ </include macros>
;------------ <init library>
@use_library
;------------ </init library>
;---------------------------------------------------------------------
;--- Start of program ----------------------------------------------
;---------------------------------------------------------------------
START:
sys_load_library library_name, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i
test eax,eax
jnz exit
window:
call draw_window ;ïåðâîíà÷àëüíî íåîáõîäèìî íàðèñîâàòü îêíî
align 4
still: ;îñíîâíîé îáðàáîò÷èê
mcall 10 ;Îæèäàòü ñîáûòèÿ
dec eax
jz window
dec eax
jz key
dec eax
jz button
push dword check1
call [check_box_mouse]
push dword check2
call [check_box_mouse]
jmp still ;åñëè íè÷åãî èç ïåðå÷èñëåííîãî òî ñíîâà â öèêë
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
button:
mcall 17 ;ïîëó÷èòü èäåíòèôèêàòîð íàæàòîé êëàâèøè
test ah,ah ;åñëè â ah 0, òî ïåðåéòè íà îáðàáîò÷èê ñîáûòèé still
jz still
exit: mcall -1
key:
mcall 2 ;çàãðóçèì çíà÷åíèå 2 â ðåãèñòîð eax è ïîëó÷èì êîä íàæàòîé êëàâèøè
jmp still
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
align 4
draw_window: ;ðèñîâàíèå îêíà ïðèëîæåíèÿ
mcall 12,1
mcall 0,(50*65536+390),(30*65536+200),0x33AABBCC,0x805080DD,hed
push dword check1
call [check_box_draw]
push dword check2
call [check_box_draw]
mcall 12,2
ret
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;DATA äàííûå
;Âñåãäà ñîáëþäàòü ïîñëåäîâàòåëüíîñòü â èìåíè.
system_path db '/sys/lib/'
library_name db 'box_lib.obj',0
; Åñëè åñòü æåëàíèå ðàçúåäèíèòü, òî íóæíî èñïîëüçîâàòü ñëåäóþùèþ êîíñòðóêöèþ
;system_path db '/sys/lib/box_lib.obj',0
;... ëþáàÿ ïîñëåäîâàòåëüíîñòü äðóãèõ êîìàíä è îïðåäåëåíèé.
;library_name db 'box_lib.obj',0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0
head_f_i:
head_f_l db 'System error',0
err_message_import db 'Error on load import library box_lib.obj',0
myimport:
check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse
version_ch dd aVersion_ch
dd 0,0
aCheck_box_draw db 'check_box_draw',0
aCheck_box_mouse db 'check_box_mouse',0
aVersion_ch db 'version_ch',0
;---------------------------------------------------------------------
check1 check_box (10 shr 16 + 12),(45 shr 16 + 12),6,0x80AABBCC,0,0,check_text,14,ch_flag_en
check2 check_box (10 shr 16 + 12),(60 shr 16 + 12),6,0x80AABBCC,0,0,check_text2,15
;---------------------------------------------------------------------
hed db 'CheckBox Exemples <Lrz> date 03.10.2010',0
hed_end:
;---------------------------------------------------------------------
check_text db 'First checkbox'
check_text2 db 'Second checkbox'
;---------------------------------------------------------------------
MEM_END:
cur_dir_path rb 1024
library_path rb 1024
rb 1024 ;for stack
PRIL_END:

View File

@ -0,0 +1,2 @@
@fasm -m 16384 checkbox.asm checkbox.kex
if exist checkbox.kex @kpack checkbox.kex

View File

@ -0,0 +1,136 @@
;Последная модификация 03.10.2010
;файл создан 13.02.2009 <Lrz> На код применена GPL2 лицензия
;Макрос для системной библиотеки box_lib.obj
;Checkbox
macro use_checkbox_draw
{
check_box_draw:
pusha ;сохраним все регистры
; mov edi,dword [esp+36]
; mov ebx,ch_left_s
; mov ecx,ch_top_s
; mov edx,dword ch_border_color
; mov eax,13
; mcall ;рисуем рамку
mcall 13,ch_left_s,ch_top_s,ch_border_color
mov edx,dword ch_color
add ebx,1 shl 16 - 2
add ecx,1 shl 16 - 2
mcall ;закрашиваем внутренности чекбокса
test dword ch_flags,2 ;достать значение бита из переменной и поместить в флаг CF
jz @f ;в если CF=1, то выполним следующую процедуру иначе перейти на нижнюю @@
call check_box_draw_ch ;нарисовать включенный чек бокс
@@:
;----------------------------
;расчет куда будет произведен вывод текста
;----------------------------
mov ebx,ch_left ;загрузить значение х для чек бокса
add ebx,dword ch_size
add ebx,dword ch_text_margin ;добавить размер стороны и расстояние на котором начнется вывод текста
shl ebx,16 ;сдвинем на 16 разрядов в лево (умножим на 65536)
mov bx,word ch_top ;загрузим значение по y
add ebx,ch_size
mov ecx,dword ch_text_color ;загрузим цвет надписи + flags
sub ebx,7 ;добавим значение длины стороны -9+2
mov edx,dword ch_text_ptr ;укажем адрес от куда нужно выводить строку
mov esi,dword ch_text_length
mov eax,4 ;внесем в eax значение вывода надписи на канву
mcall ;Вывод
popa ;восстановить значения регистров из стека
ret 4 ;выйдем из процедуры
check_box_clear_ch: ;очистка чек бокса
mov edx,dword ch_color ;цвет внутри чек бокса
jmp @f ;безусловный прыжок на нижнюю метку @@
check_box_draw_ch: ;нарисовать включенный чек бокс
mov edx,dword ch_border_color ;загрузить цвет
@@:
movzx ebx,word ch_left ;загрузить координату по х
mov eax,dword ch_size
mov di,ax
shr eax,2
push ax
push ax
add ebx,eax
shl ebx,16 ;сдвинем на 16 разрядов в лево (умножим на 65536)
pop ax
lea eax,[eax*2]
sub bp,ax ;сохраним регистр bx в регистре указателя базы
mov bx,bp
movzx ecx,word ch_top ;загрузить координату по у
pop ax
add cx,ax
shl ecx,16 ;сдвинем на 16 разрядов в лево (умножим на 65536)
mov cx,bp ;загрузим значения регистра указателя базы в cx
mov eax,13 ;в eax - значения функции для вывода полосы т.е. по сути прямоугольника, который отображает включенный компонент чек бокс
mcall ;вывод
ret ;выйти из процедуры
}
macro use_checkbox_mouse
{
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Обработчик mouse
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
check_box_mouse: ;обработка мыши
pusha
mov edi,dword [esp+36]
mov eax,37 ;будем что то делать если у нас что - нить нажато
mov ebx,2 ;внести в регистр значение 2
mcall ;проверка не нажал ли пользователь кнопку мышки
test eax,eax ;проверка если у нас в eax=0, то установим флаг и выйдем
jnz @f ;перейти на нижнюю метку @@
btr dword ch_flags,2 ;извлечение значения заданного бита в флаг cf и изменение его значения на нулевое.
jmp check_box_mouse_end
@@:
bts dword ch_flags,2 ;проверка флага т.е. перенос в cf значение бита и установка бита в состояние включено
jc check_box_mouse_end ;если CF=1 то перейти в конец т.е. это выход
mov esi,dword ch_text_length ;загрузить кол-во символов в текстовой строке
;Умножение на 6 Быстрое умножение можно воспользоваться любым мз методов, но на старых Процессорах (386,486,P1)быстрее будет с инструкцией Lea
lea esi,[eax*3]
shl esi,1
; imul esi,6 ; или можно и так умножить на 6
add esi,dword ch_text_margin ;добавить 3 - расстояние от чек бокса до надписи
mov eax,37 ;получим координаты мышки
mov ebx,1 ;добавить 1
mcall ;получить координаты курсора относительно окна
movzx ebx,word ch_top ;загрузить в bx значение координаты у
cmp ax,bx ;сравнить с с координатой курсора
jl check_box_mouse_end ;SF <> OF если меньше
add ebx,dword ch_size ;добавить размер
cmp ax,bx ;сравнить
jg check_box_mouse_end ;ZF = 0 и SF = OF если больше
shr eax,16 ;разделим на 65536 или просто сдвинем биты на 16 значений
movzx ebx,word ch_left ;произведем аналогичное сравнение
cmp ax,bx ;сравнить регистры
jl check_box_mouse_end ;если меньше
add ebx,dword ch_size ;добавить длину стороны прямоугольника
add ebx,esi ;Учесть в значении по х еще и длину надписи к чекбоксу
cmp ax,bx ;стравнить регистры
jg check_box_mouse_end ;если больше
bts dword ch_flags,1 ;извлечение значения заданного бита в флаг cf и изменение его значения на 1.
jc @f ;CF=1 то перейти на нижнюю @@
call check_box_draw_ch ;отобразить включенный чек бокс
; mov dword [esp+24],1 ;дальнейшая проверка чек боксов бесмыслена, по этому в стек, где располагается ecx поместитм 0
jmp check_box_mouse_end ;выйти
@@:
btr word ch_flags,1 ;извлечение значения заданного бита в флаг cf и изменение его значения на нулевое.
call check_box_clear_ch ;выключить чек бокс т.е. на месте закрашенного прямоугольника отобразить цвет фона.
check_box_mouse_end:
popa ;восстановить регистры из стека
ret 4 ;выйти
}

View File

@ -0,0 +1,5 @@
# This is exeperemental source code for trunk, not stable.
# Это экспериментальные наброски, которые в дальнейшем будут включены в trunk.
# Причина появления: Мной была потеряна работа по изменению библиотеки box_lib, т.к. приходиться работать на разных ПК,
# в разное время, и в разных местах.
# <Lrz>, 03/10/2010.

View File

@ -0,0 +1,4 @@
if not exist bin mkdir bin
@fasm.exe -m 16384 box_lib.asm bin\box_lib.obj
@kpack bin\box_lib.obj
pause

View File

@ -103,49 +103,48 @@ macro edit_boxes_set_sys_color start,end,color_table
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use CheckBox ;
;Last change 25.09.2010
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ch_struc_size=36
ch_flag_en=10b ;í«¥¬¥­â ¢ë¡à ­
ch_struc_size=36 ;à §¬¥à áâàãªâãàë
ch_flag_en=10b ;ä« £ ãáâ ­®¢«¥­­®£® 祪 ¡®ªá .
ch_left equ [edi] ;ª®®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® å
ch_top equ [edi+2] ;ª®®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® ã
ch_text_margin equ [edi+4] ;=4 à ááâ®ï­¨¥ ®â ¯àאַ㣮«ì­¨ª  祪 ¡®ªá  ¤® ­ ¤¯¨á¨
ch_size equ [edi+8] ;12 à §¬¥à ª¢ ¤à â  祪 ¡®ªá 
ch_color equ [edi+12] ;梥⠢­ãâਠcheckbox
ch_border_color equ [edi+16] ; or [edi+4] ;梥â à ¬ª¨ checkbox ¥¥ ¬®¦­® § ¤ âì á ¬®áâ®ï⥫쭮
ch_text_color equ [edi+20] ;[edi+4] ;梥â ⥪áâ 
ch_text_ptr equ [edi+24] ;㪠§ â¥«ì ­  ­ ç «® ⥪á⮢®© áâப¨
ch_text_length equ [edi+28]
ch_flags equ [edi+32] ;ä« £¨
ch_left equ [ebp] ;ª®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® å
ch_top equ [ebp+2] ;ª®®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® ã
ch_text_margin equ [ebp+4] ;=4 à ááâ®ï­¨¥ ®â ¯àאַ㣮«ì­¨ª  祪 ¡®ªá  ¤® ­ ¤¯¨á¨
ch_size equ [ebp+8] ;12 à §¬¥à ª¢ ¤à â  祪 ¡®ªá 
ch_color equ [ebp+12] ;梥⠢­ãâਠcheckbox
ch_border_color equ [ebp+16] ; or [edi+4] ;梥â à ¬ª¨ checkbox ¥¥ ¬®¦­® § ¤ âì á ¬®áâ®ï⥫쭮
ch_text_color equ [ebp+20] ;[edi+4] ;梥â ⥪áâ 
ch_text_ptr equ [ebp+24] ;㪠§ â¥«ì ­  ­ ç «® ⥪á⮢®© áâப¨
ch_text_length equ [ebp+28] ;¤«¨­­  áâப¨
ch_flags equ [ebp+32] ;ä« £¨
struc check_box left,top,ch_text_margin,ch_size,color,border_color,text_color,text,ch_text_length,flags
{ ;áâàãªâãà  ¯ à ¬¥â஢ ¤«ï 祪 ¡®ªá 
.left: dw left ;+0 ¯®«®¦¥­¨¥ ¯® å
.top: dw top ;+2 ¯®«®¦¥­¨¥ ¯® ã
{ ;áâàãªâãà  ¯ à ¬¥â஢ ¤«ï 祪 ¡®ªá 
.left: dw left ;+0 ¯®«®¦¥­¨¥ ¯® å
.top: dw top ;+2 ¯®«®¦¥­¨¥ ¯® ã
.ch_text_margin: dd ch_text_margin ;à ááâ®ï­¨¥ ®â ¯àאַ㣮«ì­¨ª  祪 ¡®ªá  ¤® ­ ¤¯¨á¨
.ch_size: dd ch_size ;à §¬¥à ª¢ ¤à â  祪 ¡®ªá , ¤«ï ¯à¨¬¥à  12
.color: dd color ;梥⠢­ãâਠ祪¡®ªá 
.ch_size: dd ch_size ;à §¬¥à ª¢ ¤à â  祪 ¡®ªá , ¤«ï ¯à¨¬¥à  12
.color: dd color ;梥⠢­ãâਠ祪¡®ªá 
.border_color: dd border_color ;梥â à ¬ª¨
.text_color: dd text_color ;梥⠭ ¤¯¨á¨
.text: dd text ; ¤à¥á ¢ ª®¤¥ ¯à®£à ¬¬ë £¤¥ à á¯®«®¦¥­ ⥪áâ
.ch_text_length: dd ch_text_length ;¤«¨­­  áâப¨ á ᨬ¢®« ¬¨
.flags: dd flags+0 ; ä« £¨
.flags: dd flags+0 ; ä« £¨
}
macro check_boxes_set_sys_color start,end,color_table
{
mov edi,start
mov ecx,((end-start)/ch_struc_size)
mov esi,color_table
mov edi,start
mov ecx,((end-start)/ch_struc_size)
mov esi,color_table
@@:
; push dword [esi+20] ;梥â à ¡®ç¥© ®¡« á⨠®ª­ 
; pop dword ch_color
push dword [esi+32] ;梥â ⥪áâ  ¢ à ¡®ç¥© ®¡« á⨠®ª­ 
pop dword ch_text_color
push dword [esi+36] ;梥⠣à ä¨ª¨ ¢ ®ª­¥ (à §¤¥«¨â¥«ì­ë¥ «¨­¨¨ ¨ â.¯.)
pop dword ch_border_color
add edi,ch_struc_size
loop @b
push dword [esi+32] ;梥â ⥪áâ  ¢ à ¡®ç¥© ®¡« á⨠®ª­ 
pop dword ch_text_color
push dword [esi+36] ;梥⠣à ä¨ª¨ ¢ ®ª­¥ (à §¤¥«¨â¥«ì­ë¥ «¨­¨¨ ¨ â.¯.)
pop dword ch_border_color
add edi,ch_struc_size
loop @b
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -6,45 +6,44 @@ macro use_checkbox_draw
{
check_box_draw:
pusha ;сохраним все регистры
mov edi,dword [esp+36]
mov eax,13
movzx ebx,word ch_left
shl ebx,16
add ebx,ch_size
mov ecx,ch_top
shl ecx,16
add ecx,dword ch_size
mov edx,dword ch_border_color
mcall ;рисуем рамку
mov edi,dword [esp+36]
mov eax,13
movzx ebx,word ch_left
shl ebx,16
add ebx,ch_size
mov ecx,ch_top
shl ecx,16
add ecx,dword ch_size
mov edx,dword ch_border_color
mcall ;рисуем рамку
mov edx,dword ch_color
add ebx,1 shl 16 - 2
add ecx,1 shl 16 - 2
mcall ;закрашиваем внутренности чекбокса
mov edx,dword ch_color
add ebx,1 shl 16 - 2
add ecx,1 shl 16 - 2
mcall ;закрашиваем внутренности чекбокса
test dword ch_flags,2 ;достать значение бита из переменной и поместить в флаг CF
jz @f ;в если CF=1, то выполним следующую процедуру иначе перейти на нижнюю @@
call check_box_draw_ch ;нарисовать включенный чек бокс
call check_box_draw_ch ;нарисовать включенный чек бокс
@@:
;----------------------------
;расчет куда будет произведен вывод текста
;----------------------------
movzx ebx,word ch_left ;загрузить значение х для чек бокса
add ebx,dword ch_size
add ebx,dword ch_text_margin;добавить размер стороны и расстояние на котором начнется вывод текста
shl ebx,16 ;сдвинем на 16 разрядов в лево (умножим на 65536)
mov bx,word ch_top ;загрузим значение по y
add ebx,ch_size
mov ecx,dword ch_text_color ;загрузим цвет надписи + flags
sub ebx,7 ;добавим значение длины стороны -9+2
movzx ebx,word ch_left ;загрузить значение х для чек бокса
add ebx,dword ch_size
add ebx,dword ch_text_margin ;добавить размер стороны и расстояние на котором начнется вывод текста
shl ebx,16 ;сдвинем на 16 разрядов в лево (умножим на 65536)
mov bx,word ch_top ;загрузим значение по y
add ebx,ch_size
mov ecx,dword ch_text_color ;загрузим цвет надписи + flags
sub ebx,7 ;добавим значение длины стороны -9+2
mov edx,dword ch_text_ptr ;укажем адрес от куда нужно выводить строку
mov esi,dword ch_text_length
;внесем в eax значение вывода надписи на канву
mov eax,4
mcall ;Вывод
popa ;восстановить значения регистров из стека
ret 4 ;выйдем из процедуры
mov edx,dword ch_text_ptr ;укажем адрес от куда нужно выводить строку
mov esi,dword ch_text_length
mov eax,4 ;внесем в eax значение вывода надписи на канву
mcall ;Вывод
popa ;восстановить значения регистров из стека
ret 4 ;выйдем из процедуры
check_box_clear_ch: ;очистка чек бокса
mov edx,dword ch_color ;цвет внутри чек бокса
@ -54,7 +53,7 @@ check_box_draw_ch: ;
@@:
movzx ebx,word ch_left ;загрузить координату по х
mov eax,dword ch_size
mov bp,ax
mov di,ax
shr eax,2
push ax