• R/O
  • SSH
  • HTTPS

chnosproject: Commit


Commit MetaInfo

Revisión324 (tree)
Tiempo2012-07-15 00:27:11
Autorhikarupsp

Log Message

textbox.cの実装を強化。
それなりに入力処理はできるようになった。コンソールには使えるくらいに。
対応しているのは、印字可能文字とタブ、バックスペース、改行。

Cambiar Resumen

Diferencia incremental

--- beta/tolset_chn_000/chnos_010/chnos/textbox.c (revision 323)
+++ beta/tolset_chn_000/chnos_010/chnos/textbox.c (revision 324)
@@ -14,16 +14,23 @@
1414 return textbox;
1515 }
1616
17-//bpp==0:自動選択(現在のシステムシートの設定に合わせる)
17+//bpp==0:?????I??(???݂̃V?X?e???V?[?g?̐ݒ?ɍ??킹??)
1818 uint TextBox_SetBuffer(UI_TextBox *textbox, uint xchars, uint ychars, uint bpp, UI_Sheet *parent)
1919 {
2020 if(textbox == Null){
2121 #ifdef CHNOSPROJECT_DEBUG_TEXTBOX
22- debug("TextBox_SetBuffer:Null textbox.");
23- return 1;
22+ debug("TextBox_SetBuffer:Null textbox.\n");
2423 #endif
24+ return 1;
2525 }
2626
27+ if(xchars < 4 + 1 || ychars < 1){
28+ #ifdef CHNOSPROJECT_DEBUG_TEXTBOX
29+ debug("TextBox_SetBuffer:Too small textbox.\n");
30+ #endif
31+ return 2;
32+ }
33+
2734 textbox->chars.x = xchars;
2835 textbox->chars.y = ychars;
2936 textbox->size_text_buf = textbox->chars.x * textbox->chars.y;
@@ -32,10 +39,10 @@
3239 Sheet_SetBuffer(textbox->sheet, Null, xchars << 3, ychars << 4, bpp);
3340 Sheet_SetParent(textbox->sheet, parent);
3441
35- textbox->sheet->Drawing.Fill_Rectangle(textbox->sheet, textbox->backcol, 0, 0, (int)textbox->sheet->size.x - 1, (int)textbox->sheet->size.y - 1);
42+ Sheet_Drawing_Fill_Rectangle(textbox->sheet, textbox->backcol, 0, 0, (int)textbox->sheet->size.x - 1, (int)textbox->sheet->size.y - 1);
3643
3744 textbox->text_buf = System_Memory_Allocate(textbox->size_text_buf);
38- textbox->text_buf[0] = Null;
45+ textbox->text_buf[0] = 0x00;
3946
4047 textbox->flags.bit.textbuffer_configured = True;
4148
@@ -46,31 +53,231 @@
4653 {
4754 if(textbox == Null){
4855 #ifdef CHNOSPROJECT_DEBUG_TEXTBOX
49- debug("TextBox_Show:Null textbox.");
50- return 1;
56+ debug("TextBox_Show:Null textbox.\n");
5157 #endif
58+ return 1;
5259 }
5360
61+ if(textbox->sheet == Null){
62+ #ifdef CHNOSPROJECT_DEBUG_TEXTBOX
63+ debug("TextBox_Show:Null textbox sheet.\n");
64+ #endif
65+ return 2;
66+ }
67+
5468 return Sheet_Show(textbox->sheet, height, px, py);
5569 }
5670
57-uint TextBox_Put_Character(UI_TextBox *textbox, uchar c)
71+//char??n?????Ƃ??”\?B
72+//Break???̃L?[?R?[?h?͖??????ĉ??????͂??Ȃ??ikeyid?𒼐ړn???????œ??͂??ł???悤?ɂ??邽?߁j?B
73+//?^?u?????́A?L?^???I?t?̎??̂ݓ??͉”\?B
74+uint TextBox_Put_Character(UI_TextBox *textbox, ushort keyid)
5875 {
5976 uchar s[2];
77+ uint i;
6078
61- s[0] = c;
62- s[1] = 0x00;
79+ if(textbox == Null){
80+ #ifdef CHNOSPROJECT_DEBUG_TEXTBOX
81+ debug("TextBox_Put_Character:Null textbox.\n");
82+ #endif
83+ return 1;
84+ }
6385
64- #ifdef CHNOSPROJECT_DEBUG_TEXTBOX
65- debug("TextBox_Put_Character:put [%c].\n", c);
66- #endif
86+ if(textbox->sheet == Null){
87+ #ifdef CHNOSPROJECT_DEBUG_TEXTBOX
88+ debug("TextBox_Put_Character:Null textbox sheet.\n");
89+ #endif
90+ return 2;
91+ }
6792
68- textbox->sheet->Drawing.Put_String(textbox->sheet, textbox->location_cursor.x, textbox->location_cursor.y, textbox->forecol, s);
69- Sheet_RefreshSheet(textbox->sheet, textbox->location_cursor.x, textbox->location_cursor.y, textbox->location_cursor.x + 8 - 1, textbox->location_cursor.y + 16 - 1);
93+ if(!(keyid & KEYID_MASK_BREAK)){
94+ if(keyid & KEYID_MASK_EXTENDED){ /*???䕶??*/
95+ switch(keyid & KEYID_MASK_ID){
96+ case KEYID_ENTER:
97+/*
98+ if(TextBox_Internal_Put_Character_TextBuffer(textbox, '\n')){
99+ textbox->location_cursor.x = 0;
100+ textbox->location_cursor.y += 16;
101+ }
102+*/
103+ TextBox_Put_Character(textbox, '\n');
104+ break;
105+ case KEYID_BACKSPACE:
106+/*
107+ if(textbox->location_cursor.x <= 0 && textbox->location_cursor.y <= 0){
108+ break;
109+ }
110+ if(TextBox_Internal_Put_Character_TextBuffer(textbox, '\b')){
111+ textbox->location_cursor.x -= 8;
112+ }
113+ if(textbox->location_cursor.x < 0){
114+ textbox->location_cursor.x = 0;
115+ textbox->location_cursor.y -= 16;
116+ if(textbox->flags.bit.record_input_text){
117+ for(i = 0; i < textbox->using_text_buf; i++){
118+ if(textbox->text_buf[textbox->using_text_buf - i - 1] == '\n'){
119+ break;
120+ }
121+ textbox->location_cursor.x += 8;
122+ if(textbox->location_cursor.x >= (int)textbox->sheet->size.x - (8 - 1)){
123+ textbox->location_cursor.x = 0;
124+ }
125+ if(textbox->using_text_buf - i - 1 == 0){
126+ break;
127+ }
128+ }
129+ } else{
130+ textbox->location_cursor.x = (int)textbox->sheet->size.x - 8;
131+ }
132+ }
133+*/
134+ TextBox_Put_Character(textbox, '\b');
135+ break;
136+ case KEYID_TAB:
137+/*
138+ if(!textbox->flags.bit.record_input_text && TextBox_Internal_Put_Character_TextBuffer(textbox, '\b')){
139+ textbox->location_cursor.x += 8 * (4 - ((textbox->location_cursor.x >> 3) & 3));
140+ }
141+ if(textbox->location_cursor.x > (int)textbox->sheet->size.x){
142+ textbox->location_cursor.x = 8 * 4;
143+ textbox->location_cursor.y += 16;
144+ } else if(textbox->location_cursor.x == (int)textbox->sheet->size.x){
145+ textbox->location_cursor.x = 0;
146+ textbox->location_cursor.y += 16;
147+ }
148+*/
149+ TextBox_Put_Character(textbox, '\t');
150+ break;
151+ }
152+ return 0;
153+ } else{ /*ASCII????*/
154+ s[0] = keyid & KEYID_MASK_ID;
155+ s[1] = 0x00;
156+ if(s[0] == '\n'){
157+ if(TextBox_Internal_Put_Character_TextBuffer(textbox, '\n')){
158+ textbox->location_cursor.x = 0;
159+ textbox->location_cursor.y += 16;
160+ }
161+ } else if(s[0] == '\b'){
162+ if(!(textbox->location_cursor.x <= 0 && textbox->location_cursor.y <= 0)){
163+ if(TextBox_Internal_Put_Character_TextBuffer(textbox, '\b')){
164+ textbox->location_cursor.x -= 8;
165+ }
166+ if(textbox->location_cursor.x < 0){
167+ textbox->location_cursor.x = 0;
168+ textbox->location_cursor.y -= 16;
169+ if(textbox->flags.bit.record_input_text){
170+ for(i = 0; i < textbox->using_text_buf; i++){
171+ if(textbox->text_buf[textbox->using_text_buf - i - 1] == '\n'){
172+ break;
173+ }
174+ textbox->location_cursor.x += 8;
175+ if(textbox->location_cursor.x >= (int)textbox->sheet->size.x - (8 - 1)){
176+ textbox->location_cursor.x = 0;
177+ }
178+ if(textbox->using_text_buf - i - 1 == 0){
179+ break;
180+ }
181+ }
182+ } else{
183+ textbox->location_cursor.x = (int)textbox->sheet->size.x - 8;
184+ }
185+ }
186+ }
187+ } else if(s[0] == '\t'){
188+ if(!textbox->flags.bit.record_input_text && TextBox_Internal_Put_Character_TextBuffer(textbox, '\t')){
189+ textbox->location_cursor.x += 8 * (4 - ((textbox->location_cursor.x >> 3) & 3));
190+ }
191+ if(textbox->location_cursor.x > (int)textbox->sheet->size.x){
192+ textbox->location_cursor.x = 8 * 4;
193+ textbox->location_cursor.y += 16;
194+ } else if(textbox->location_cursor.x == (int)textbox->sheet->size.x){
195+ textbox->location_cursor.x = 0;
196+ textbox->location_cursor.y += 16;
197+ }
198+ } else if(TextBox_Internal_Put_Character_TextBuffer(textbox, s[0])){
199+ #ifdef CHNOSPROJECT_DEBUG_TEXTBOX
200+ debug("TextBox_Put_Character:put [%c].\n", s[0]);
201+ #endif
202+ Sheet_Drawing_Put_String(textbox->sheet, textbox->location_cursor.x, textbox->location_cursor.y, textbox->forecol, s);
203+ Sheet_RefreshSheet(textbox->sheet, textbox->location_cursor.x, textbox->location_cursor.y, textbox->location_cursor.x + 8 - 1, textbox->location_cursor.y + 16 - 1);
204+ textbox->location_cursor.x += 8;
205+ if(textbox->location_cursor.x >= (int)textbox->sheet->size.x - (8 - 1)){
206+ textbox->location_cursor.x = 0;
207+ textbox->location_cursor.y += 16;
208+ }
209+ }
210+ }
211+ if(textbox->location_cursor.y >= (int)textbox->sheet->size.y - (16 - 1)){
212+ Sheet_Drawing_Scroll_Vertical(textbox->sheet, 16);
213+ Sheet_Drawing_Fill_Rectangle(textbox->sheet, textbox->backcol, 0, (int)textbox->sheet->size.y - 16, (int)textbox->sheet->size.x - 1, (int)textbox->sheet->size.y - 1);
214+ textbox->location_cursor.y -= 16;
215+ Sheet_RefreshSheet_All(textbox->sheet);
216+ }
217+ Sheet_Drawing_Fill_Rectangle(textbox->sheet, textbox->backcol, textbox->location_cursor.x, textbox->location_cursor.y, textbox->location_cursor.x + 8 - 1, textbox->location_cursor.y + 16 - 1);
218+ Sheet_RefreshSheet(textbox->sheet, textbox->location_cursor.x, textbox->location_cursor.y, textbox->location_cursor.x + 8 - 1, textbox->location_cursor.y + 16 - 1);
219+ }
70220
71- textbox->location_cursor.x += 8;
72221 return 0;
73222 }
74223
224+uint TextBox_Put_String(UI_TextBox *textbox, const uchar s[])
225+{
226+ uint i;
75227
228+ for(i = 0; s[i] != 0x00; i++){
229+ TextBox_Put_Character(textbox, s[i]);
230+ }
231+ return 0;
232+}
76233
234+bool TextBox_Internal_Put_Character_TextBuffer(UI_TextBox *textbox, uchar c)
235+{
236+ if(!textbox->flags.bit.record_input_text){
237+ return True;
238+ }
239+
240+ switch(c){
241+ case '\b':
242+ if(textbox->using_text_buf > 0){
243+ textbox->using_text_buf--;
244+ textbox->text_buf[textbox->using_text_buf] = 0x00;
245+ return True;
246+ }
247+ break;
248+ default:
249+ if(textbox->using_text_buf < textbox->size_text_buf - 1){
250+ textbox->text_buf[textbox->using_text_buf] = c;
251+ textbox->using_text_buf++;
252+ textbox->text_buf[textbox->using_text_buf] = 0x00;
253+ return True;
254+ }
255+ break;
256+ }
257+ return False;
258+}
259+
260+//False->True?Ńo?b?t?@???Z?b?g?B
261+bool TextBox_SetEnable_RecordInputText(UI_TextBox *textbox, bool enable)
262+{
263+ bool old;
264+
265+ if(textbox == Null){
266+ #ifdef CHNOSPROJECT_DEBUG_TEXTBOX
267+ debug("TextBox_SetEnable_RecordInputText:Null textbox.\n");
268+ #endif
269+ return 1;
270+ }
271+
272+ old = textbox->flags.bit.record_input_text;
273+
274+ if(old != enable){
275+ if(enable){
276+ textbox->text_buf[0] = 0x00;
277+ textbox->using_text_buf = 0;
278+ }
279+ textbox->flags.bit.record_input_text = enable;
280+ }
281+
282+ return old;
283+}
--- beta/tolset_chn_000/chnos_010/chnos/core.h (revision 323)
+++ beta/tolset_chn_000/chnos_010/chnos/core.h (revision 324)
@@ -26,6 +26,7 @@
2626 uint rand(void);
2727 uint isqrt(uint n);
2828 uint CFunction_ExtractBits(uint source, uint start, uint end);
29+uint CFunction_MemoryMove(void *destination, uint destination_size, void *source, uint source_size);
2930 int snprintf(uchar s[], uint n, const uchar format[], ...);
3031 int vsnprintf(uchar s[], uint n, const uchar format[], uint vargs[]);
3132 //
@@ -290,6 +291,7 @@
290291 uint Sheet_Drawing_Fill_Rectangle(UI_Sheet *sheet, uint c, int px0, int py0, int px1, int py1);
291292 uint Sheet_Drawing_Put_String(UI_Sheet *sheet, int x, int y, uint fc, const uchar s[]);
292293 uint Sheet_Drawing_Draw_Point(UI_Sheet *sheet, int x, int y, uint c);
294+uint Sheet_Drawing_Scroll_Vertical(UI_Sheet *sheet, int vpx);
293295 //
294296 uint Sheet_Drawing_Fill_Rectangle_Invalid(UI_Sheet *sheet, uint c, int px0, int py0, int px1, int py1);
295297 uint Sheet_Drawing_Put_String_Invalid(UI_Sheet *sheet, int x, int y, uint fc, const uchar s[]);
@@ -362,7 +364,10 @@
362364 UI_TextBox *TextBox_Initialise(void);
363365 uint TextBox_SetBuffer(UI_TextBox *textbox, uint xchars, uint ychars, uint bpp, UI_Sheet *parent);
364366 uint TextBox_Show(UI_TextBox *textbox, uint height, int px, int py);
365-uint TextBox_Put_Character(UI_TextBox *textbox, uchar c);
367+uint TextBox_Put_Character(UI_TextBox *textbox, ushort keyid);
368+uint TextBox_Put_String(UI_TextBox *textbox, const uchar s[]);
369+bool TextBox_Internal_Put_Character_TextBuffer(UI_TextBox *textbox, uchar c);
370+bool TextBox_SetEnable_RecordInputText(UI_TextBox *textbox, bool enable);
366371
367372 /*timer.c タイマー関連*/
368373 UI_TimerControl *Initialise_ProgrammableIntervalTimer(void);
--- beta/tolset_chn_000/chnos_010/chnos/cfunc.c (revision 323)
+++ beta/tolset_chn_000/chnos_010/chnos/cfunc.c (revision 324)
@@ -125,6 +125,62 @@
125125 return (source >> start) & ~(0xffffffff << (end - start + 1));
126126 }
127127
128+//source番地からの、destination_sizeを超えないsource_sizeバイトを、destination番地へ移動させる。
129+//メモリ範囲が重なっていてもデータは破壊されない。
130+//同一番地へコピーする場合は何もしない。
131+//戻り値は、コピーしたバイト数。
132+uint CFunction_MemoryMove(void *destination, uint destination_size, void *source, uint source_size)
133+{
134+ uint move_size, i;
135+ void *temp;
136+
137+ if(destination == source){
138+ return 0;
139+ }
140+
141+ if(destination_size <= source_size){
142+ move_size = destination_size;
143+ } else{
144+ move_size = source_size;
145+ }
146+
147+ if((uint)source < (uint)destination && (uint)source + source_size > (uint)destination){
148+ //sourceを上書きしてしまう場合、一度バッファに退避させた後コピーする。
149+ temp = System_Memory_Allocate(move_size);
150+ i = 0;
151+ if(move_size >= 4){
152+ for(; i < move_size - (4 - 1); i += 4){
153+ ((uint *)temp)[i >> 2] = ((uint *)source)[i >> 2];
154+ }
155+ }
156+ if(i != move_size){
157+ for(; i < move_size; i++){
158+ ((uchar *)temp)[i] = ((uchar *)source)[i];
159+ }
160+ }
161+ } else{
162+ temp = source;
163+ }
164+
165+ i = 0;
166+ if(move_size >= 4){
167+ for(; i < move_size - (4 - 1); i += 4){
168+ ((uint *)destination)[i >> 2] = ((uint *)temp)[i >> 2];
169+ }
170+ }
171+ if(i != move_size){
172+ for(; i < move_size; i++){
173+ ((uchar *)destination)[i] = ((uchar *)temp)[i];
174+ }
175+ }
176+
177+ if(temp != source){
178+ System_Memory_Free(temp, move_size);
179+ }
180+
181+ return move_size;
182+}
183+
128184 //引数(uchar s[], uint n, const uchar format[], ...)
129185 // s :結果を書き込む文字列の先頭アドレスを指定します。
130186 // n :s[]の大きさを指定します。(n - 1)番目以降の文字は書き込まれません。
--- beta/tolset_chn_000/chnos_010/chnos/bootpack.c (revision 323)
+++ beta/tolset_chn_000/chnos_010/chnos/bootpack.c (revision 324)
@@ -29,6 +29,7 @@
2929 Sheet_Drawing_Put_String(vramsheet, 10, 10, 0x000000, "Welcome to CHNOSProject!");
3030
3131 if(disp_ctrl->display_mode == DISPLAYMODE_VBE_LINEAR){
32+ i = 0;
3233 Sheet_Drawing_Put_String(vramsheet, 10, 10 + 16 * 1, 0x000000, "Please Select the VideoMode Number.");
3334 Sheet_Drawing_Put_String(vramsheet, 10, 10 + 16 * 2, 0x000000, "(Use cursor Up or Down, Select Enter.)");
3435 Sheet_Drawing_Fill_Rectangle(vramsheet, 0x00ff00, 10, 10 + 16 * 3, VGA08_VRAM_XSIZE - 10 - 1, 10 + 16 * 5 - 1);
@@ -110,6 +111,8 @@
110111 textbox = TextBox_Initialise();
111112 TextBox_SetBuffer(textbox, 20, 6, 8, testsheet);
112113 TextBox_Show(textbox, 0, 4, 24);
114+ TextBox_Put_Character(textbox, '>');
115+ TextBox_SetEnable_RecordInputText(textbox, True);
113116
114117
115118 Drawing08_Put_String(testsheet->vram, testsheet->size.x, 4, 4, 0xffffff, "TestSheet");
@@ -172,36 +175,14 @@
172175 data = FIFO32_MyTaskFIFO_Get();
173176 if(SIGNAL_KEY_OFFSET <= data && data <= (SIGNAL_KEY_OFFSET + 0xFFFF)){
174177 data -= SIGNAL_KEY_OFFSET;
178+ TextBox_Put_Character(textbox, data);
175179 if(!(data & KEYID_MASK_BREAK) && (data & KEYID_MASK_EXTENDED)){
176- if((data & KEYID_MASK_ID) == KEYID_CURSOR_U){
177- if(data & KEYID_MASK_STATE_SHIFT){
178- Sheet_Slide_Relative(testsheet, 5, -5);
179- } else{
180- Sheet_Slide_Relative(testsheet, 0, -5);
181- }
182- } else if((data & KEYID_MASK_ID) == KEYID_CURSOR_D){
183- if(data & KEYID_MASK_STATE_SHIFT){
184- Sheet_Slide_Relative(testsheet, -5, 5);
185- } else{
186- Sheet_Slide_Relative(testsheet, 0, 5);
187- }
188- } else if((data & KEYID_MASK_ID) == KEYID_CURSOR_L){
189- if(data & KEYID_MASK_STATE_SHIFT){
190- Sheet_Slide_Relative(testsheet, -5, -5);
191- } else{
192- Sheet_Slide_Relative(testsheet, -5, 0);
193- }
194- } else if((data & KEYID_MASK_ID) == KEYID_CURSOR_R){
195- if(data & KEYID_MASK_STATE_SHIFT){
196- Sheet_Slide_Relative(testsheet, 5, 5);
197- } else{
198- Sheet_Slide_Relative(testsheet, 5, 0);
199- }
200- } else if((data & KEYID_MASK_ID) == KEYID_ENTER){
201- Sheet_Slide_Absolute(testsheet, disp_ctrl->xsize >> 1, disp_ctrl->ysize >> 1);
180+ if((data & KEYID_MASK_ID) == KEYID_ENTER){
181+ TextBox_SetEnable_RecordInputText(textbox, False);
182+ TextBox_Put_String(textbox, textbox->text_buf);
183+ TextBox_Put_Character(textbox, '>');
184+ TextBox_SetEnable_RecordInputText(textbox, True);
202185 }
203- } else if(!(data & KEYID_MASK_BREAK) && !(data & KEYID_MASK_EXTENDED)){
204- TextBox_Put_Character(textbox, data & KEYID_MASK_ID);
205186 }
206187 } else if(data == 11){
207188 Drawing08_Fill_Rectangle(testsheet->vram, testsheet->size.x, 0xc6c6c6, 8, 24, 8 + (20 * 8) - 1, 24 + (16 * 2) - 1);
--- beta/tolset_chn_000/chnos_010/chnos/keyid.h (revision 323)
+++ beta/tolset_chn_000/chnos_010/chnos/keyid.h (revision 324)
@@ -17,6 +17,7 @@
1717 //つまり、FIFOで受け取って、バイアスを引いたら、KEYID_EXTENDEDフラグを調べる。
1818 //次に、BREAKフラグを調べる。
1919 //そして、下位7ビットのみを参照する。
20+//KEYID==0x0000は、ID未処理であることを示し、どの文字を表すこともない。
2021
2122 #define KEYID_MASK_ID 0x007f
2223 #define KEYID_MASK_BREAK 0x0080
--- beta/tolset_chn_000/chnos_010/chnos/shtdraw.c (revision 323)
+++ beta/tolset_chn_000/chnos_010/chnos/shtdraw.c (revision 324)
@@ -3,19 +3,69 @@
33
44 uint Sheet_Drawing_Fill_Rectangle(UI_Sheet *sheet, uint c, int px0, int py0, int px1, int py1)
55 {
6+ if(sheet == Null){
7+ return 1;
8+ }
9+
10+ if(sheet->vram == Null){
11+ return 2;
12+ }
13+
614 return sheet->Drawing.Fill_Rectangle(sheet, c, px0, py0, px1, py1);
715 }
816
917 uint Sheet_Drawing_Put_String(UI_Sheet *sheet, int x, int y, uint fc, const uchar s[])
1018 {
19+ if(sheet == Null){
20+ return 1;
21+ }
22+
23+ if(sheet->vram == Null){
24+ return 2;
25+ }
26+
1127 return sheet->Drawing.Put_String(sheet, x, y, fc, s);
1228 }
1329
1430 uint Sheet_Drawing_Draw_Point(UI_Sheet *sheet, int x, int y, uint c)
1531 {
32+ if(sheet == Null){
33+ return 1;
34+ }
35+
36+ if(sheet->vram == Null){
37+ return 2;
38+ }
39+
1640 return sheet->Drawing.Draw_Point(sheet, x, y, c);
1741 }
1842
43+uint Sheet_Drawing_Scroll_Vertical(UI_Sheet *sheet, int vpx)
44+{
45+ if(sheet == Null){
46+ return 1;
47+ }
48+
49+ if(sheet->vram == Null){
50+ return 2;
51+ }
52+
53+ if(vpx > 0){
54+ if((uint)vpx >= sheet->size.y){
55+ return 3;
56+ }
57+ CFunction_MemoryMove(sheet->vram, sheet->vramsize, (void *)((uint)sheet->vram + (sheet->size.x * vpx * (sheet->bpp >> 3))), sheet->vramsize - (sheet->size.x * vpx * (sheet->bpp >> 3)));
58+ } else if(vpx < 0){
59+ vpx = -vpx;
60+ if((uint)vpx >= sheet->size.y){
61+ return 4;
62+ }
63+ CFunction_MemoryMove((void *)((uint)sheet->vram + (sheet->size.x * vpx * (sheet->bpp >> 3))), sheet->vramsize - (sheet->size.x * vpx * (sheet->bpp >> 3)), sheet->vram, sheet->vramsize);
64+ }
65+
66+ return 0;
67+}
68+
1969 //invalid
2070 uint Sheet_Drawing_Fill_Rectangle_Invalid(UI_Sheet *sheet, uint c, int px0, int py0, int px1, int py1)
2171 {
--- beta/tolset_chn_000/chnos_010/chnos/coredef0.h (revision 323)
+++ beta/tolset_chn_000/chnos_010/chnos/coredef0.h (revision 324)
@@ -21,7 +21,7 @@
2121 //#define CHNOSPROJECT_DEBUG_MULTITASK
2222 //#define CHNOSPROJECT_DEBUG_PCI
2323 //#define CHNOSPROJECT_DEBUG_COMMON_STRUCT
24- #define CHNOSPROJECT_DEBUG_TEXTBOX
24+ //#define CHNOSPROJECT_DEBUG_TEXTBOX
2525 #endif
2626
2727 /*defines*/
@@ -354,3 +354,4 @@
354354 #define SHEET_MAX_YSIZE 65535
355355 #define SHEET_MAX_CHILDREN 255
356356 #define SHEET_LOCATION_NOCHANGE 0x7ffffffe
357+
--- beta/tolset_chn_000/chnos_010/chnos/coredef1.h (revision 323)
+++ beta/tolset_chn_000/chnos_010/chnos/coredef1.h (revision 324)
@@ -466,7 +466,7 @@
466466 struct UI_SHEET *child; //children lowest height
467467 DATA_Location2D location;
468468 DATA_Location2DU size;
469- ushort bpp; //0:Text(16col) 1:8bit 2:16bit 3:32bit
469+ ushort bpp;
470470 union UI_SHEET_FLAGS {
471471 ushort flags;
472472 struct UI_SHEET_FLAGS_BITS {
@@ -569,11 +569,13 @@
569569 DATA_Location2DU chars;
570570 uchar *text_buf;
571571 uint size_text_buf;
572+ uint using_text_buf;
572573 union UI_TEXT_BOX_FLAGS {
573574 uint flags;
574575 struct UI_TEXT_BOX_BITS {
575576 unsigned initialized : 1;
576577 unsigned textbuffer_configured : 1;
578+ unsigned record_input_text : 1;
577579 } bit;
578580 } flags;
579581 } UI_TextBox;
Show on old repository browser