kolibrios-gitea/programs/develop/libraries/box_lib/C--/trunk/EditBox2.c--
Alexey Teplov ( e1ff25c4c9 some upgrade. It's work with last library box_lib.obj.
git-svn-id: svn://kolibrios.org@1217 a494cfbc-eb01-0410-851d-a64ba20cac60
2009-10-16 02:01:53 +00:00

97 lines
3.6 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//EditBox in C-- example v0.1
//Veliant 2007 Leency 2008
#pragma option A
#codesize
#include "..\lib\kolibri.h--"
#include "use_library.h--"
//////////////////////////////////////////////////////////////////
//Bit mask from editbox
//////////////////////////////////////////////////////////////////
//char edit_path[256] = "You can edit me!"; //ᮤ¥à¦¨¬®¥ EditBox'a
char way_of_ini[250] = "/sys/lib/box_lib.obj",NULL; //ᮤ¥à¦¨¬®¥ EditBox'a
dword mouse_dd;
edit_box edit1= {250,14,35,0xffffff,0x6f9480,0,0xAABBCC,0,248,#way_of_ini,#mouse_dd,2,20,20};
//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_flags equ [edi+40] ;ä« £¨
//ed_size equ [edi+42] ;ª®«-¢® ᨬ¢®«®¢
//ed_pos equ [edi+46] ;¯®§¨æ¨ï ªãàá®à 
//ed_offset equ [edi+50] ;ᬥ饭¨¥
//cl_curs_x equ [edi+54] ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® å
//cl_curs_y equ [edi+58] ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® ã
//ed_shift_pos equ [edi+62] ;¯®«®¦¥­¨¥ ªãàá®à 
//ed_shift_pos_old equ [edi+66] ;áâ à®¥ ¯®«®¦¥­¨¥ ªãàá®à 
proc_info Form;
void main()
byte id;
{
load_dll();
draw_window();
loop()
{
switch(WaitEvent())
{
//Button pressed----------------------------------------------------
CASE evButton:
id=GetButtonID();
IF (id==1) || (id==2) ExitProcess();
break;
//Key pressed-------------------------------------------------------
case evKey:
GetKey();
edit_box_key stdcall (#edit1);
break;
case evReDraw: draw_window(); break;
// default: break;
}
edit_box_mouse stdcall (#edit1);
}
ExitProcess();
}
void draw_window()
{
WindowRedrawStatus(1);
skin_width = GetSkinWidth();
DefineAndDrawWindow(400,200,280,200,0x04,0x00E4DFE1,0,0,0); DrawTitle("Extended EditBox in C--");
Form.getme();
//òåêñò
WriteText(30,40,0x80,0,"<22> ¨¯à®á⥩訩 ¯à¨¬¥à EditBox'a ­  --",0);
WriteText(30,50,0x80,0,"<22>® ¥£® ¬®¦­® ­¥¬­®£® ãá«®¦­¨âì á 楫ìî",0);
WriteText(30,60,0x80,0,"㬥­ì襭¨ï ¯¥à¥à¨á®¢ª¨.",0);
//êíîïû
DrawFlatButton(100,105,70,22,2,0xD7D7D7,"Close");
//EditBox
// DrawRegion(30,14,201,16,0x94AECE); //®¡®¤®ª ¯®«®áë  ¤à¥á 
edit_box_draw stdcall (#edit1);
// typedef void (*edit_box_draw)(dword edit_b); // ®¡ê¥­¨¥ 㪠§ â¥«ï ­  äã­ªæ¨î
// edit_box_draw(edit_b); // ¢ë§®¢ ä㭪樨
WindowRedrawStatus(2);
}
stop: