kolibrios/programs/develop/libraries/box_lib/C--/trunk/EditBox2.c--

97 lines
3.6 KiB
Plaintext
Raw Normal View History

//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!"; //ᮤ<><EFBFBD><E0A6A8><EFBFBD> EditBox'a
char way_of_ini[250] = "/sys/lib/box_lib.obj",NULL; //ᮤ<><EFBFBD><E0A6A8><EFBFBD> EditBox'a
edit_box edit1= {250,14,35,0xffffff,0x6f9480,0,0xAABBCC,0,248,#way_of_ini,2,20,20};
//ed_width equ [edi] ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//ed_left equ [edi+4] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20>
//ed_top equ [edi+8] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20>
//ed_color equ [edi+12] ;梥<><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//shift_color equ [edi+16] ;=0x6a9480
//ed_focus_border_color equ [edi+20] ;梥<><><E0A0AC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//ed_blur_border_color equ [edi+24] ;梥<> <20><> <20><><EFBFBD><E2A8A2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//ed_text_color equ [edi+28] ;梥<><><E2A5AA><EFBFBD>
//ed_max equ [edi+32] ;<3B><><EFBFBD>-<2D><><><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E1A8AC><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//ed_text equ [edi+36] ;㪠<><E3AAA0><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
//ed_flags equ [edi+40] ;䫠<><E4ABA0>
//ed_size equ [edi+42] ;<3B><><EFBFBD>-<2D><><><E1A8AC><EFBFBD><EFBFBD><EFBFBD>
//ed_pos equ [edi+46] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//ed_offset equ [edi+50] ;ᬥ饭<E1ACA5><E9A5AD>
//cl_curs_x equ [edi+54] ;<3B><EFBFBD><E0A5A4><EFBFBD><20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>
//cl_curs_y equ [edi+58] ;<3B><EFBFBD><E0A5A4><EFBFBD><20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>
//ed_shift_pos equ [edi+62] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//ed_shift_pos_old equ [edi+66] ;<3B><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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();
//<2F><><EFBFBD><EFBFBD><EFBFBD>
WriteText(30,40,0x80,0,"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥩訩 <20><EFBFBD><E0A8AC> EditBox'a <20><> <20>--",0);
WriteText(30,50,0x80,0,"<22><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E1ABAE><EFBFBD><EFBFBD><EFBFBD> <20><><E6A5AB>",0);
WriteText(30,60,0x80,0,"㬥<><E3ACA5><EFBFBD><E8A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2>.",0);
//<2F><><EFBFBD><EFBFBD><EFBFBD>
DrawFlatButton(100,105,70,22,2,0xD7D7D7,"Close");
//EditBox
// DrawRegion(30,14,201,16,0x94AECE); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
edit_box_draw stdcall (#edit1);
// typedef void (*edit_box_draw)(dword edit_b); // <20><><EFBFBD><EFBFBD><EFA2AB><EFBFBD><EFBFBD><><E3AAA0><EFBFBD> <20><> <20><EFBFBD><E3ADAA><EFBFBD>
// edit_box_draw(edit_b); // <20><EFBFBD> <20>㭪樨
WindowRedrawStatus(2);
}
stop: