// полна¤ отрисовка главного окна программы (1) void DrawMainWindow() { char line[64]; // kos_WindowRedrawStatus( WRS_BEGIN ); // окно kos_DefineAndDrawWindow( WNDLEFT, WNDTOP, mcx + 1, mcy + 21, 0x54, 0x0, // Skinned fixed size window, dont fill working area, window has caption 0, WNDHEADCOLOUR, mainWndTitle ); // заголовок окна kos_ChangeWindowCaption(mainWndTitle); mainWndFace.Draw( 1, 21 ); // перва¤ строка kos_WriteTextToWindow( 8, 32, 0, 0x0, mainWndMenuStart, sizeof(mainWndMenuStart)-1 ); // треть¤ строка sprintf( line, mainWndMenuLevel, startGameLevel); kos_WriteTextToWindow( 8, 64, 0, 0x0, line, strlen( line ) ); // кнопки kos_DefineButton( mcx - 29, 64, 12, 12, BT_SIZE_X_MINUS, 0xCCCCCC ); // kos_PutImage( bmPMButton + 12, 6, 2, mcx - 29 + 3, 69 ); // kos_DefineButton( mcx - 16, 64, 12, 12, BT_SIZE_X_PLUS, 0xCCCCCC ); // kos_PutImage( bmPMButton, 6, 6, mcx - 16 + 3, 67 ); // копирайт kos_WriteTextToWindow( 8, mcy - 16 + 21, 0, 0x000066, mainWndCopyright, sizeof(mainWndCopyright)-1 ); // kos_WindowRedrawStatus( WRS_END ); }
void DrawWindow() { kos_WindowRedrawStatus(1); kos_DefineAndDrawWindow(10, 40, WINDOW_WIDTH + 8, WINDOW_HEIGHT + 25, 0x33, BG_COLOR, 0, 0, (Dword)header); kos_WindowRedrawStatus(2); kos_WindowRedrawStatus(1); /// DEL!!!!11 OnMouseMove(); // Draw buildings for (int i = 20; i < 5 * 50; i += 50) { house->Draw(i, 467, H_COLOR); } for (int i = 8 * 50; i < 13 * 50; i += 50) { house->Draw(i, 467, H_COLOR); } }
void draw_window() { double xx0=0.0, yy0=0.0; sProcessInfo info; void *p; if (sel_end_move) sel_moved = 0; memset((Byte*)&info, 0, 1024); kos_ProcessInfo(&info, 0xFFFFFFFF); p = info.rawData + 42; // magic wi = *(Dword *)(p); he = *(Dword *)((Byte *)p + 4); win_x = *(Dword *)((Byte *)p - 8); win_y = *(Dword *)((Byte *)p - 4); myPID = *(Dword*)((Byte *)p - 12); if (wi == 0) wi = WND_W; if (he == 0) he = WND_H; he -= kos_GetSkinHeight() + MENU_PANEL_HEIGHT; // доступная высота окна wi -= 10; if (window_drawall==true){ kos_WindowRedrawStatus(1); kos_DefineAndDrawWindow(10,40,WND_W,WND_H,0x33,0x40FFFFFF,0,0,(Dword)"Table v" TABLE_VERSION); kos_WindowRedrawStatus(2); if (info.rawData[70]&0x04) return; //ничего не делать если окно схлопнуто в заголовок if (he < 100) kos_ChangeWindow( -1, -1, -1, 180 ); if (wi < 340) kos_ChangeWindow( -1, -1, 350, -1 ); } // edit_box_draw((dword)&ebox); int y = he + kos_GetSkinHeight() - 10; if (!sel_moved) { kos_DrawBar(wi-15,he - kos_GetSkinHeight() +7,16,16,0xe4dfe1); kos_DrawBar(0,he - kos_GetSkinHeight() + 23,wi + 1,MENU_PANEL_HEIGHT-5,0xe4dfe1); kos_WriteTextToWindow(3 + 1, y + 3, 0x80 , 0x000000, (char*)sFilename, strlen(sFilename)); } //DWORD fn_line_color = fn_edit ? 0x000000 : 0xc0c0c0; //kos_DrawRegion(61, y - 2, 102, 18, fn_line_color, 0); // дальше editbox width = 100 // border around edit box file_box.left = 64; file_box.top = y - 1; file_box.width = 98; //editbox_h = 18; // сохранить kos_DefineButton(20 + 160, y - 5, 60, 20, SAVE_BUTTON, 0xd0d0d0); kos_WriteTextToWindow(22 + 160 + (60 - strlen(sSave) * 6) / 2, y + 2, 0, 0x000000, (char*)sSave, strlen(sSave)); // загрузить kos_DefineButton(90 + 160, y - 5, 60, 20, LOAD_BUTTON, 0xd0d0d0); kos_WriteTextToWindow(92 + 160 + (60 - strlen(sLoad) * 6) / 2, y + 2, 0, 0x000000, (char*)sLoad, strlen(sLoad)); // создать. только эту кнопу воткнуть некуда о_О /* kos_DefineButton(90 + 160 + 70, y - 5, 60, 20, NEW_BUTTON, 0xd0d0d0); kos_WriteTextToWindow(92 + 160 + 10 + 70, y + 2, 0, 0x000000, (char*)sNew, strlen(sNew)); */ panel_y = y; if ((void*)edit_box_draw != NULL) { if (is_edit) edit_box_draw((DWORD)&cell_box); edit_box_draw((DWORD)&file_box); } draw_grid(); window_drawall=false; sel_moved = 0; }
void draw_window(void){ //Рисуем окно sProcessInfo sPI; kos_WindowRedrawStatus(1); kos_DefineAndDrawWindow(10,10,619,179+kos_GetSkinHeight(),0x74, 0xDDDDFF, 0,0, (Dword)header); kos_WindowRedrawStatus(2); kos_ProcessInfo( &sPI ); if (sPI.rawData[70]&0x04) return; //ничего не делать если окно схлопнуто в заголовок if (status==0){ //Меню kos_DrawBar(0,0,610,175,0xFFFFBB); kos_WriteTextToWindow (10,10,0x80,0x000000, "Љв® е®зҐв Ўлвм ¬Ё««Ё®Ґа®¬?", 3); kos_WriteTextToWindow (10,25,0x80,0x000000, sVersion, 3); kos_WriteTextToWindow (10,70,0x80,0x770000, "<ENTER> - з вм ЁЈаг", 0); kos_WriteTextToWindow (10,85,0x80,0x770000, "<ESC> - ўл室", 0); kos_WriteTextToWindow (10,150,0x80,0x000000, "(C) 2008 Ђ¤аҐ© ЊЁе ©«®ўЁз aka Dron2004", 0); //kos_DisplayNumberToWindow (questioncount,3,40,60,0x000000, nbDecimal, false); } if (status==1){ //Игра kos_DrawBar(0,0,610,175,0xEEEEFF); kos_WriteTextToWindow (10,10,0x0,0x000000, question, questionlength-1); if (drawA==true){ kos_WriteTextToWindow (10,40,0x80,0x000000, "A. ", 0); kos_WriteTextToWindow (30,40,0x0,0x000000, answerA, answerAlength-1); } if (drawB==true){ kos_WriteTextToWindow (10,60,0x80,0x000000, "B. ", 0); kos_WriteTextToWindow (30,60,0x0,0x000000, answerB, answerBlength-1); } if (drawC==true){ kos_WriteTextToWindow (10,80,0x80,0x000000, "C. ", 0); kos_WriteTextToWindow (30,80,0x0,0x000000, answerC, answerClength-1); } if (drawD==true){ kos_WriteTextToWindow (10,100,0x80,0x000000, "D. ", 0); kos_WriteTextToWindow (30,100,0x0,0x000000, answerD, answerDlength-1); } if (na50available==true){kos_WriteTextToWindow (30,150,0x80,0x000000, "<7> 50 50", 0);} if (callfriendavailable==true){kos_WriteTextToWindow (150,150,0x80,0x000000, "<8> ‡ў®®Є ¤агЈг", 0);} if (zalavailable==true){kos_WriteTextToWindow (280,150,0x80,0x000000, "<9> Џ®¤бЄ §Є § « ", 0);} if((na50available==false)&&(callfriendavailable==false)&&(zalavailable==false)) {kos_WriteTextToWindow (30,150,0x80,0x000000, "<BACKSPACE> - § Ўа вм ¤ҐмЈЁ Ё г©вЁ", 0);} kos_WriteTextToWindow (430,130,0x80,0x000000, "‚®Їа®б ", 0); kos_WriteTextToWindow (500,130,0x80,0x000000, summs[currentquestion], 0); kos_WriteTextToWindow (430,150,0x80,0x000000, "“ ў б", 0); kos_WriteTextToWindow (500,150,0x80,0x000000, summs[currentquestion-1], 0); } if (status==2){ //Окно "Это - правильный ответ" kos_DrawBar(0,0,610,175,0xDDFFDD); kos_WriteTextToWindow (10,10,0x80,0x000000, "„ , нв® Їа ўЁ«мл© ®вўҐв!", 0); kos_WriteTextToWindow (10,150,0x80,0x000000, "<ENTER> - Їа®¤®«¦Ёвм", 0); } if (status==3){ //Вы выиграли миллион, однако ж!!! kos_DrawBar(0,0,610,175,0x00FF00); kos_WriteTextToWindow (10,10,0x80,0x000000, "‚л ўлЁЈа «Ё ¬Ё««Ё®!!!", 0); kos_WriteTextToWindow (10,150,0x80,0x000000, "<ESC> - ўл室", 0); } if (status==4){ //Звонок другу kos_DrawBar(0,0,610,175,0xAAFFFF); kos_WriteTextToWindow (10,10,0x80,0x000000, "„агЈ б®ўҐвгҐв ў ¬ ®вўҐв", 0); kos_WriteTextToWindow (165,10,0x80,0x000000, friendsAdvice, 0); kos_WriteTextToWindow (10,150,0x80,0x000000, "<ENTER> - Їа®¤®«¦Ёвм", 0); } if (status==5){ //Подсказка зала kos_DrawBar(0,0,610,175,0xAAFFFF); kos_WriteTextToWindow (10,10,0x80,0x000000, "ЊҐЁҐ г¤Ёв®аЁЁ а бЇаҐ¤Ґ«Ё«®бм в Є:", 0); if (drawA==true){ kos_WriteTextToWindow (10,30,0x80,0x000000, "ЋвўҐв A: ", 0); kos_DisplayNumberToWindow(zalA,3,60,30,0x000000,nbDecimal,0); kos_WriteTextToWindow (80,30,0x80,0x000000, "%", 0); } if (drawB==true){ kos_WriteTextToWindow (10,45,0x80,0x000000, "ЋвўҐв B: ", 0); kos_DisplayNumberToWindow(zalB,3,60,45,0x000000,nbDecimal,0); kos_WriteTextToWindow (80,45,0x80,0x000000, "%", 0); } if (drawC==true){ kos_WriteTextToWindow (10,60,0x80,0x000000, "ЋвўҐв C: ", 0); kos_DisplayNumberToWindow(zalC,3,60,60,0x000000,nbDecimal,0); kos_WriteTextToWindow (80,60,0x80,0x000000, "%", 0); } if (drawD==true){ kos_WriteTextToWindow (10,75,0x80,0x000000, "ЋвўҐв D: ", 0); kos_DisplayNumberToWindow(zalD,3,60,75,0x000000,nbDecimal,0); kos_WriteTextToWindow (80,75,0x80,0x000000, "%", 0); } kos_WriteTextToWindow (10,150,0x80,0x000000, "<ENTER> - Їа®¤®«¦Ёвм", 0); } if (status==6){ //Вы забрали деньги ;-) kos_DrawBar(0,0,610,175,0xBBFFBB); kos_WriteTextToWindow (10,10,0x80,0x000000, "‚л § Ўа «Ё ¤ҐмЈЁ Ё ги«Ё. ‚ и ўлЁЈали б®бв ўЁ«:", 0); kos_WriteTextToWindow (10,20,0x80,0x000000, summs[currentquestion-1], 0); kos_WriteTextToWindow (10,150,0x80,0x000000, "<ESC> - ўл室", 0); } if (status==-1){ //Вы ошиблись :-( kos_DrawBar(0,0,610,175,0xFF8888); kos_WriteTextToWindow (10,10,0x80,0x000000, "Љ ᮦ «ҐЁо, ўл ®иЁЎ«Ёбм... Џа ўЁ«мл© ®вўҐв -", 0); switch (correctanswer){ case 0x01: kos_WriteTextToWindow (10,25,0x80,0x000000, "A. ", 0); kos_WriteTextToWindow (30,25,0x0,0x000000, answerA, answerAlength-1); break; case 0x02: kos_WriteTextToWindow (10,25,0x80,0x000000, "B. ", 0); kos_WriteTextToWindow (30,25,0x0,0x000000, answerB, answerBlength-1); break; case 0x03: kos_WriteTextToWindow (10,25,0x80,0x000000, "C. ", 0); kos_WriteTextToWindow (30,25,0x0,0x000000, answerC, answerClength-1); break; case 0x04: kos_WriteTextToWindow (10,25,0x80,0x000000, "D. ", 0); kos_WriteTextToWindow (30,25,0x0,0x000000, answerD, answerDlength-1); break; } kos_WriteTextToWindow (10,50,0x80,0x000000, "‚ १г«мв ⥠ўл ўлЁЈа «Ё:", 0); if (currentquestion<6) {kos_WriteTextToWindow (220,50,0x80,0x000000,summs[0], 0);} if ((currentquestion>5)&&(currentquestion<11)) {kos_WriteTextToWindow (220,50,0x80,0x000000,summs[5], 0);} if (currentquestion>10) {kos_WriteTextToWindow (220,50,0x80,0x000000,summs[10], 0);} kos_WriteTextToWindow (10,150,0x80,0x000000, "<ESC> - ўл室", 0); } }