Jump to content

Sergey Kushnir

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by Sergey Kushnir

  1. I went through the debugger and figured out the logic of the window manager. The _gwinFlushRedraws function contains two branches: "Do loss of visibility first" and "Do the visible windows next". The new window is redrawn twice, here's why. The first time as a hidden window, but the visibility flag is already set. The second time as a window that is visible. It turns out that we need to somehow make it so that the new window is not redrawn as invisible. Is it possible to do this?
  2. Hello! I recorded a video The screen is redrawn more than once. I did not find the reason for this phenomenon quickly. I need help. When uGFX is initialized, screen elements are formed in the usual way, nothing extra. At the beginning, when you press the button, the screen with the button is hidden and a function is called that makes the screen with TabSet visible. case GEVENT_GWIN_BUTTON: ///(GEVENT_GWIN_CTRL_FIRST+0) if (((GEventGWinButton*)pe)->gwin == mainProductButton) { gwinHide(mainContainer); _ghActiveScreen = productScreenShow(); } GHandle productScreenShow(void) { productScreenUpdate(); gwinShow(prodTabset); return prodTabset; } Clicking on tabs only causes one screen repaint. See video. When returning to the previous screen, it is redrawn twice. I set a breakpoint on the gwinTabsetDraw_Std function and got this call stack: What should be done to make the screen redrawn once? The screen is redrawn more than once.mp4
  3. For local use this solution seems logical.
  4. Hello! The language support problem in this case can be solved in two ways. The first is to use, for example, encoding 866 with Cyrillic support or ISO/IEC 8859-5. also known as the fifth sets of the ISO/IEC 8859 8-bit character encoding. The second is intended for UTF-8 and is solved by modifying the TextEditRemoveChar method of the TextEdit widget by adding analysis of the removed character.
  5. I found a piece of a code // Fonts font_t open_sans24,open_sans28; // Слушатель событий GListener glistener; GHandle ghKeyboard, ghConsole1; GEvent* pe; GEventKeyboard * pk; void guiCreate(void) { GWidgetInit wi; // Apply some default values for GWIN gwinWidgetClearInit(&wi); wi.g.show = TRUE; // Prepare fonts - #define GDISP_INCLUDE_FONT_DEJAVUSANSxx TRUE - reqd in gfxconf.h) open_sans24 = gdispOpenFont("open_sans24"); open_sans28 = gdispOpenFont("open_sans28"); // Создаем "слушателя" события geventListenerInit(&glistener); geventAttachSource(&glistener, ginputGetMouse(0), GLISTEN_MOUSEDOWNMOVES|GLISTEN_MOUSEMETA); gwinAttachListener(&glistener); // Устанавливаем дефолтные стили GUI gwinSetDefaultFont(open_sans24);//DejaVuSans20 gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); // Create the keyboard wi.g.show = gTrue; wi.g.x = 0; wi.g.y = gdispGetHeight()/2; wi.g.width = gdispGetWidth(); wi.g.height = gdispGetHeight()/2; ghKeyboard = gwinKeyboardCreate(0, &wi); gwinKeyboardSetLayout(ghKeyboard, &VirtualKeyboard_EnRu1); gwinSetFont(ghKeyboard, open_sans28); // We also want to listen to keyboard events from the virtual keyboard geventAttachSource(&glistener, gwinKeyboardGetEventSource(ghKeyboard), GLISTEN_KEYTRANSITIONS|GLISTEN_KEYUP); // Create console widget: ghConsole1 wi.g.parent = ghPage1; wi.g.show = TRUE; wi.g.x = 300; wi.g.y = 2; wi.g.width = 700; wi.g.height = 290; wi.text = "Ready"; wi.customParam = 0; wi.customStyle = 0; ghConsole1 = gwinConsoleCreate(0, &wi.g); gwinSetFont(ghConsole1, dejavu_sans_12); gwinSetColor(ghConsole1, Black); gwinSetBgColor(ghConsole1, HTML2COLOR(0xd2d2d2)); gwinShow(ghConsole1); gwinClear(ghConsole1); } ...... while (1) { // Get an Event pe = geventEventWait(&glistener, 1000); switch(pe->type) { case GEVENT_GWIN_KEYBOARD: ///(GEVENT_GWIN_CTRL_FIRST+6) // This is a widget event generated on the standard gwin event source gwinPrintf(ghConsole1, "Keyboard visibility has changed\n"); break; case GEVENT_KEYBOARD: // This is a keyboard event from a keyboard source which must be separately listened to. // It is not sent on the gwin event source even though in this case it was generated by a gwin widget. pk = (GEventKeyboard *)pe; gwinPrintf(ghConsole1, "KEYSTATE: 0x%04X [ %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s]", pk->keystate, (!pk->keystate ? "NONE " : ""), ((pk->keystate & GKEYSTATE_KEYUP) ? "KEYUP " : ""), ((pk->keystate & GKEYSTATE_REPEAT) ? "REPEAT " : ""), ((pk->keystate & GKEYSTATE_SPECIAL) ? "SPECIAL " : ""), ((pk->keystate & GKEYSTATE_RAW) ? "RAW " : ""), ((pk->keystate & GKEYSTATE_SHIFT_L) ? "LSHIFT " : ""), ((pk->keystate & GKEYSTATE_SHIFT_R) ? "RSHIFT " : ""), ((pk->keystate & GKEYSTATE_CTRL_L) ? "LCTRL " : ""), ((pk->keystate & GKEYSTATE_CTRL_R) ? "RCTRL " : ""), ((pk->keystate & GKEYSTATE_ALT_L) ? "LALT " : ""), ((pk->keystate & GKEYSTATE_ALT_R) ? "RALT " : ""), ((pk->keystate & GKEYSTATE_FN) ? "FN " : ""), ((pk->keystate & GKEYSTATE_COMPOSE) ? "COMPOSE " : ""), ((pk->keystate & GKEYSTATE_WINKEY) ? "WINKEY " : ""), ((pk->keystate & GKEYSTATE_CAPSLOCK) ? "CAPSLOCK " : ""), ((pk->keystate & GKEYSTATE_NUMLOCK) ? "NUMLOCK " : ""), ((pk->keystate & GKEYSTATE_SCROLLLOCK) ? "SCROLLLOCK " : "") ); if (pk->bytecount) { gwinPrintf(ghConsole1, " Keys:"); for (i = 0; i < pk->bytecount; i++) gwinPrintf(ghConsole1, " 0x%02X", (int)(gU8)pk->c[i]); gwinPrintf(ghConsole1, " ["); for (i = 0; i < pk->bytecount; i++) gwinPrintf(ghConsole1, "%c", pk->c[i] >= ' ' && pk->c[i] <= '~' ? pk->c[i] : ' '); gwinPrintf(ghConsole1, "]"); } gwinPrintf(ghConsole1, "\n"); break; } }
  6. GHandle KeyboardNum; // Create the keyboard GWidgetInit wi; gwinWidgetClearInit(&wi); wi.g.show = gTrue; wi.g.x = 200; wi.g.y = 185; wi.g.width = 660; wi.g.height = 240; wi.text = "KeybNum"; KeyboardNum = gwinKeyboardCreate(0, &wi); gwinKeyboardSetLayout(KeyboardNum, &VirtualKeyboard_Num); gwinSetFont(KeyboardNum, dejavu_sans_con28); // We also want to listen to keyboard events from the virtual keyboard geventAttachSource(&glistener, gwinKeyboardGetEventSource(KeyboardNum), GLISTEN_KEYTRANSITIONS|GLISTEN_KEYUP);
  7. /* * This file is subject to the terms of the GFX License. If a copy of * the license was not distributed with this file, you can obtain one at: * * http://ugfx.io/license.html */ #include "../../gfx.h" #if GFX_USE_GWIN && GWIN_NEED_KEYBOARD #include "gwin_keyboard_layout.h" #if GWIN_NEED_KEYBOARD_ENGLISH1 /* For this keyboard mapping we use: * Set 0 = Lowercase letters * Set 1 = Uppercase letters (transient) * Set 2 = Uppercase letters (locked) * Set 3 = Numbers * Set 4 = Symbols */ static const GVSpecialKey Eng1SKeys[] = { { "\001", 0, GVKEY_SINGLESET, 1 }, // \001 (1) = Shift Lower to Upper { "\001", 0, GVKEY_INVERT|GVKEY_LOCKSET, 2 }, // \002 (2) = Shift Upper to Upper Lock { "\002", 0, GVKEY_INVERT|GVKEY_LOCKSET, 0 }, // \003 (3) = Shift Upper Lock to Lower { "123", 0, GVKEY_LOCKSET, 3 }, // \004 (4) = Change to Numbers { "\010", "\b", 0, 0 }, // \005 (5) = Backspace { "\015", "\r", 0, 0 }, // \006 (6) = Enter 1 { "\015", "\r", 0, 0 }, // \007 (7) = Enter 2 (Short keycap) { "Sym", 0, GVKEY_LOCKSET, 4 }, // \010 (8) = Change to Symbols { "aA", 0, GVKEY_LOCKSET, 0 }, // \011 (9) = Change to Lower Alpha }; static const char Eng1Set0Row3[] = "\004 .\006\006"; static const char Eng1Set1Row0[] = "QWERTYUIOP"; static const char Eng1Set1Row1[] = "ASDFGHJKL"; static const char *Eng1Set0[] = { "qwertyuiop", "asdfghjkl", "\001zxcvbnm\005", Eng1Set0Row3, 0 }; static const char *Eng1Set1[] = { Eng1Set1Row0, Eng1Set1Row1, "\002ZXCVBNM\005", Eng1Set0Row3, 0 }; static const char *Eng1Set2[] = { Eng1Set1Row0, Eng1Set1Row1, "\003ZXCVBNM\005", Eng1Set0Row3, 0 }; static const char *Eng1Set3[] = { "+-*/", "@789", "\007456", "\010123", "\01100.", 0 }; static const char *Eng1Set4[] = { "#$%^&*()", "~`:;\"'{}", "<>?/\\|[]", "\011\004,! .@", 0 }; static const GVKeySet Eng1Sets[] = { Eng1Set0, Eng1Set1, Eng1Set2, Eng1Set3, Eng1Set4, 0 }; const GVKeyTable VirtualKeyboard_English1 = { Eng1SKeys, Eng1Sets }; #endif // GWIN_NEED_KEYBOARD_ENGLISH1 #if GWIN_NEED_KEYBOARD_EN_RU1 /* For this keyboard mapping we use: * Set 0 = Lowercase letters * Set 1 = Uppercase letters (transient) * Set 2 = Uppercase letters (locked) * Set 3 = Numbers * Set 4 = Symbols */ static const GVSpecialKey Eng1SKeys[] = { { "\001", 0, GVKEY_SINGLESET, 1 }, // \001 (1) = Shift Lower to Upper { "\001", 0, GVKEY_INVERT|GVKEY_LOCKSET, 2 }, // \002 (2) = Shift Upper to Upper Lock { "\002", 0, GVKEY_INVERT|GVKEY_LOCKSET, 0 }, // \003 (3) = Shift Upper Lock to Lower { "123", 0, GVKEY_LOCKSET, 3 }, // \004 (4) = Change to Numbers { "\010", "\b", 0, 0 }, // \005 (5) = Backspace { "\015", "\r", 0, 0 }, // \006 (6) = Enter 1 { "\015", "\r", 0, 0 }, // \007 (7) = Enter 2 (Short keycap) { "Sym", 0, GVKEY_LOCKSET, 4 }, // \010 (8) = Change to Symbols { "aA", 0, GVKEY_LOCKSET, 0 }, // \011 (9) = Change to Lower Alpha { "RU", 0, GVKEY_LOCKSET, 5 }, // \012 (10) = Change to Lower Alpha { "EN", 0, GVKEY_LOCKSET, 0 }, // \013 (11) = Change to Lower Alpha { "\001", 0, GVKEY_SINGLESET, 6 }, // \014 (12) = Shift Lower to Upper { "\001", 0, GVKEY_INVERT|GVKEY_LOCKSET, 7 }, // \015 (13) = Shift Upper to Upper Lock { "\002", 0, GVKEY_INVERT|GVKEY_LOCKSET, 5 }, // \016 (14) = Shift Upper Lock to Lower }; static const char Eng1Set0Row3[] = "\004\012 .\006\006"; static const char Ru1Set0Row3[] = "\004\004\013 .\006\006"; static const char Eng1Set1Row0[] = "QWERTYUIOP"; static const char Eng1Set1Row1[] = "ASDFGHJKL"; static const char Ru1Set1Row0[] = "ЙЦУКЕНГШЩЗХЪ"; static const char Ru1Set1Row1[] = "ФЫВАПРОЛДЖЭ"; static const char *Eng1Set0[] = { "qwertyuiop", "asdfghjkl", "\001zxcvbnm\005", Eng1Set0Row3, 0 }; static const char *Eng1Set1[] = { Eng1Set1Row0, Eng1Set1Row1, "\002ZXCVBNM\005", Eng1Set0Row3, 0 }; static const char *Eng1Set2[] = { Eng1Set1Row0, Eng1Set1Row1, "\003ZXCVBNM\005", Eng1Set0Row3, 0 }; static const char *Eng1Set3[] = { "+-*/", "@789", "\007456", "\010123", "\01100.", 0 }; static const char *Eng1Set4[] = { "#$%^&*()", "~`:;\"'{}", "<>?/\\|[]", "\011\004,! .@", 0 }; static const char *Rus1Set0[] = { "йцукенгшщзхъ", "фывапролджэ", "\014ячсмитьбю\005", Ru1Set0Row3, 0 }; static const char *Rus1Set1[] = { Ru1Set1Row0, Ru1Set1Row1, "\015ЯЧСМИТЬБЮ\005", Ru1Set0Row3, 0 }; static const char *Rus1Set2[] = { Ru1Set1Row0, Ru1Set1Row1, "\016ЯЧСМИТЬБЮ\005", Ru1Set0Row3, 0 }; static const GVKeySet Eng1Sets[] = { Eng1Set0, Eng1Set1, Eng1Set2, Eng1Set3, Eng1Set4, Rus1Set0, Rus1Set1, Rus1Set2, 0 }; const GVKeyTable VirtualKeyboard_EnRu1 = { Eng1SKeys, Eng1Sets }; #endif // GWIN_NEED_KEYBOARD_ENGLISH1 #if GWIN_NEED_KEYBOARD_NUM /* For this keyboard mapping we use: * Set 0 = Lowercase letters * Set 1 = Uppercase letters (transient) * Set 2 = Uppercase letters (locked) * Set 3 = Numbers * Set 4 = Symbols */ static const GVSpecialKey NumSKeys[] = { { "\001", 0, GVKEY_SINGLESET, 1 }, // \001 (1) = Shift Lower to Upper { "\001", 0, GVKEY_INVERT|GVKEY_LOCKSET, 2 }, // \002 (2) = Shift Upper to Upper Lock { "\002", 0, GVKEY_INVERT|GVKEY_LOCKSET, 0 }, // \003 (3) = Shift Upper Lock to Lower { "123", 0, GVKEY_LOCKSET, 3 }, // \004 (4) = Change to Numbers { "\010", "\b", 0, 0 }, // \005 (5) = Backspace { "\015", "\r", 0, 0 }, // \006 (6) = Enter 1 { "\015", "\r", 0, 0 }, // \007 (7) = Enter 2 (Short keycap) { "Sym", 0, GVKEY_LOCKSET, 4 }, // \010 (8) = Change to Symbols { "aA", 0, GVKEY_LOCKSET, 0 }, // \011 (9) = Change to Lower Alpha { "RU", 0, GVKEY_LOCKSET, 5 }, // \012 (10) = Change to Lower Alpha { "EN", 0, GVKEY_LOCKSET, 0 }, // \013 (11) = Change to Lower Alpha { "\001", 0, GVKEY_SINGLESET, 6 }, // \014 (12) = Shift Lower to Upper { "\001", 0, GVKEY_INVERT|GVKEY_LOCKSET, 7 }, // \015 (13) = Shift Upper to Upper Lock { "\002", 0, GVKEY_INVERT|GVKEY_LOCKSET, 5 }, // \016 (14) = Shift Upper Lock to Lower { "ESC", "\x1b", 0, 0 }, // \017 (15) = Escape }; static const char *NumSet3[] = { "789\017", "456-", "123\005", "00.\007", 0 }; static const GVKeySet NumSets[] = { NumSet3, 0 }; const GVKeyTable VirtualKeyboard_Num = { NumSKeys, NumSets }; #endif // GWIN_NEED_KEYBOARD_ENGLISH1 #endif // GFX_USE_GWIN && GWIN_NEED_KEYBOARD It is my code for keyboards
  8. Thank's for your reply! This solution is work perfectly!
  9. #if GDISP_NEED_CLIP gdispGSetClip(gw->g.display, gw->g.x +gw->g.width -4, gw->g.y +offset +1, bar_width, bar_height); #endif
  10. Thank you for the answer, inmarket! I know and understand that uGFX is a very simple graphics library. Therefore, I try to look for solutions similar to those you described in point 1. But sometimes there are situations that cannot be avoided. I just need to understand how to crop the widget display with minimal actions. For example, as shown in the photo, the upper window overlaps the right side of the table. Accordingly, it is possible to reconfigure the constraints for displaying the table. How can this be done with the existing library tools? Will this require making changes to the widget? I assume the following actions. The table is drawn. After some time, a window is called that should be drawn above the table and overlap it. New constraint coordinates are passed to the table object. The table is drawn with these constraints. After some time, the window is closed. Data with the constraints that were there before are passed to the table object. The table is drawn with these constraints. That's all. This is a case in which everything is done manually, but it suits me quite well, since such cases will be very rare. I rely on the fact that widgets call setclip(...) when drawing.
  11. I have encountered such a problem. A table is displayed on the screen, in which a row is updated. On command from the button, a frame window with a console is displayed, which overlaps the table. However, the updated part of the table overlaps the window with the console and spoils the view. How to solve this problem? Photos shows this problem.
  12. This project was created in 2006 for BelAZ. A competition was organized, and we won among 4 participants. The first version was developed in 1 year. This is an industrial application in serial production. Now, of course, the following versions are used, but the interface design developed by me remains approximately the same. You can find a lot on YouTube. The circuit uses the Atmel AT91SAM7A3 controller, 128 KB flash and 96 KB RAM. The software uses FreeRTOS version 3 with a C++ wrapper. GUI is a deeply reworked someone's library. The entire software took about 60 KB, and graphic primitives and fonts - about 40 KB. Display control via a 16-bit bus. 24-bit address and 16-bit data. Thanks to the use of the built-in graphics accelerator and software tricks, it was possible to raise the fps to 100. I learned a lot from this project.
  13. Hi, Joel! I'm not a magician, I'm just learning. :). This is my software - BELAZ dashboard. 2006.
  14. Hi, Joel! I have been observing the effect associated with the button for a long time, as shown in the video. I fought it by switching the button or container to the hide or unvisible state. But perhaps this is wrong. This effect occurs when any button is pressed. As I understand it, the rendering sequence looks like this. 1. The "External connection" button is pressed and the pressed state is rendered. 2. The button is released and the released button is rendered (more precisely, it is queued for rendering). 3. The released button event is processed. Here, the function for creating a container with the OK button is called, which, when pressed, must be destroyed. 4. The container and its button are rendered. 5. Pressing the OK button first renders the "External connection" button, and then renders the OK button. Is the queue being "pushed"? 6. The container is destroyed. 7. The container with the "External connection" button is rendered. How can I prevent this effect from occurring? What am I doing wrong? Main Window #include "Screens.h" #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <ctype.h> #include <limits.h> #include <float.h> #include "LT7381-HAL.h" #include "WidgetStyles.h" #include "StringsTableIDs.h" #define Gray_80_ HTML2COLOR(0x808080) extern GListener glistener; extern GHandle _ghStatusbar, ActiveScreen; extern font_t dejavu_sans_con12,dejavu_sans_con16,dejavu_sans_con18,dejavu_sans_con20,dejavu_sans_con22,dejavu_sans_con24,dejavu_sans_con28, dejavu_sans_con36, dejavu_sans_con72; static GHandle mainAttestatButton, mainProductButton, mainExtConnectButton, mainSettingsButton, mainTitleLabel; static GHandle mainContainer; gFont mainFont2x; extern font_t dejavu_sans_12,dejavu_sans_16,dejavu_sans_18,dejavu_sans_20,dejavu_sans_22,dejavu_sans_24,dejavu_sans_32; static gBool mainScreenIsCreated = gFalse; GButtonObject *mainExtConnectButtonObj; void MainScreenCreate(void) { GWidgetInit wi; gwinWidgetClearInit(&wi); wi.g.show = TRUE; wi.g.width = gdispGetWidth(); wi.g.height = gdispGetHeight() - _ghStatusbar->height; wi.g.x = 0, wi.g.y =0; wi.text = "mainContainer"; mainContainer = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER); wi.g.parent = mainContainer; wi.g.width = 600; wi.g.height = gdispGetFontMetric(dejavu_sans_con72, gFontHeight); wi.g.x = 260; wi.g.y = 0; wi.text = GSByID(SID_OperMode); mainTitleLabel = gwinLabelCreate(0, &wi); gwinSetFont(mainTitleLabel, dejavu_sans_con72); wi.g.y += wi.g.height + 10; wi.g.height = 100; wi.customDraw = gwinButtonDraw_Rounded; wi.text = GSByID(SID_Product); mainProductButton = gwinButtonCreate(0, &wi); gwinSetFont(mainProductButton, dejavu_sans_con36); wi.g.y += wi.g.height + 20; wi.text = GSByID(SID_ExConnect); mainExtConnectButton = gwinButtonCreate(0, &wi); gwinSetFont(mainExtConnectButton, dejavu_sans_con36); wi.g.y += wi.g.height + 20; wi.text = GSByID(SID_Attestat); mainAttestatButton = gwinButtonCreate(0, &wi); gwinSetFont(mainAttestatButton, dejavu_sans_con36); wi.g.y += wi.g.height + 20; wi.text = GSByID(SID_Settings); mainSettingsButton = gwinButtonCreate(0, &wi); gwinSetFont(mainSettingsButton, dejavu_sans_con36); mainScreenIsCreated = gTrue; ActiveScreen = mainContainer; mainExtConnectButtonObj = (GButtonObject *)mainExtConnectButton; } void mainScreenDestroy(void) { gwinDestroy(mainContainer); mainScreenIsCreated = gFalse; } void mainScreenShow(void) { gwinSetText(mainTitleLabel, GSByID(SID_OperMode), gFalse); gwinSetText(mainProductButton, GSByID(SID_Product), gFalse); gwinSetText(mainExtConnectButton, GSByID(SID_ExConnect), gFalse); gwinSetText(mainAttestatButton, GSByID(SID_Attestat), gFalse); gwinSetText(mainSettingsButton, GSByID(SID_Settings), gFalse); gwinShow(mainContainer); } void MainScreenEv(GEvent *pe) { // if (!mainScreenIsCreated) return; switch(pe->type) { case GEVENT_GWIN_BUTTON: ///(GEVENT_GWIN_CTRL_FIRST+0) if (((GEventGWinButton*)pe)->gwin == mainProductButton) { DummyScreenCreate(0); } if (((GEventGWinButton*)pe)->gwin == mainExtConnectButton) { // DummyScreenCreate(0); ManualScreenCreate(0); } if (((GEventGWinButton*)pe)->gwin == mainAttestatButton) { AttScreenCreate(0); } if (((GEventGWinButton*)pe)->gwin == mainSettingsButton) { SettingsScreenCreate(); } break; } } Under Construction Window #include "Screens.h" #include "StringsTableIDs.h" extern GHandle _ghStatusbar, ActiveScreen; extern GListener glistener; extern font_t dejavu_sans_con12,dejavu_sans_con16,dejavu_sans_con18,dejavu_sans_con20,dejavu_sans_con22,dejavu_sans_con24,dejavu_sans_con28, dejavu_sans_con36, dejavu_sans_con72; static GHandle dummyContainer = NULL, dummyTitleLabel = NULL, dummyCloseButton = NULL; static gBool dummyScreenIsCreated = gFalse; static retFunc_t dummyRetFunc = NULL; void DummyScreenCreate(retFunc_t func) { dummyRetFunc = func; GWidgetInit wi; gwinWidgetClearInit(&wi); wi.g.show = TRUE; // Create the Container wi.g.width = gdispGetWidth(); wi.g.height = gdispGetHeight() - _ghStatusbar->height; wi.g.x = 0, wi.g.y =0; wi.text = "dummyContainer"; dummyContainer = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER); wi.g.parent = dummyContainer; wi.g.width = 700; wi.g.height = gdispGetFontMetric(dejavu_sans_con72, gFontHeight); wi.g.x = 175; wi.g.y = 200; wi.text = GSByID(SID_UnderConstraction); dummyTitleLabel = gwinLabelCreate(0, &wi); gwinSetFont(dummyTitleLabel, dejavu_sans_con72); wi.g.y = 450; wi.g.width = 500; wi.g.height = 100; wi.g.x = 260; wi.customDraw = gwinButtonDraw_Rounded; wi.text = GSByID(SID_Close); dummyCloseButton = gwinButtonCreate(0, &wi); gwinSetFont(dummyCloseButton, dejavu_sans_con36); dummyScreenIsCreated = gTrue; ActiveScreen = dummyContainer; } void DummyScreenDestroy(void) { gwinDestroy(dummyContainer); dummyScreenIsCreated = gFalse; } void DummyScreenEv(GEvent *pe) { if (!dummyScreenIsCreated) return; switch(pe->type) { case GEVENT_GWIN_BUTTON: ///(GEVENT_GWIN_CTRL_FIRST+0) if (((GEventGWinButton*)pe)->gwin == dummyCloseButton) { DummyScreenDestroy(); } break; } } Thak you for answer! Buttons.zip
  15. Thank you very much, Joel! I try it.
  16. I have successfully implemented drawing of graphic primitives using the built-in Geometric Drawing Engine. But I have the following question. Preamble. My project uses a display with a screen size of 1024x600 pixels. The exchange rate between the control controller and the display is not enough and leads to flickering of the screen elements. This is annoying for the user. The memory size of the LT7381 display controller is 32 Mbit and can accommodate two images. If one image is displayed on the display, the second image - the shadow screen - can be prepared. The cycle of drawing and displaying can be represented as follows (real code of another project): void CDisplay::RedrawStaticScreen(void) { // Filling the shadow screen area // Displaying the menu m_pMenu->Draw(m_pGui); // Drawing the screen m_pCurrentScreen->DrawStatic(); m_pCurrentScreen->DrawRefresh(m_iFrameIndex, true); // Switching the active frame m_pHal->FrameActivate(m_iFrameIndex); if (1 < (++m_iFrameIndex)) m_iFrameIndex = 0; // Filling the second screen area // Displaying the menu m_pMenu->Draw(m_pGui); // Drawing the screen m_pCurrentScreen->DrawStatic(); m_pCurrentScreen->DrawRefresh(m_iFrameIndex, true); } The question is: where in the library uGFX can you switch screens?
  17. I understand that I am tampering with the library's code, and it becomes unique to me. Well, I'm ready!
  18. I also thought in this direction. Your answer confirms that this is the correct way. I was looking to see if maybe there is some *.h file included as an extension in the main code. Sometimes they do this.
  19. Hi folks! I use High Performance TFT-LCD Graphics Controller LT7381 with Geometric Drawing Engine and I want to use hardware functions of drawing Circles, Ellipses, Boxes, Rounded Boxes and etc. I found how to draw lines and fill a rectangle using GDISP_HARDWARE_LINES and GDISP_HARDWARE_FILLS. For example, for GDISP_HARDWARE_CIRCLE I did not find the corresponding code. How to do it right without interfering with the uGFX library? Thanks!
  20. I have prepared a small project. I'm not sure if it's completely correct because I'm using the IAR IDE, but the main idea is there. I hope that you can get the effect that I got. Thak you! TableParentTabset.rar
  21. Ok, Joel! I will prepare a project with this problem. It's not urgent, just curious how it happens.
  22. I discovered a small detail: if you prohibit the Title rendering (#define GWIN_NEED_TABLE_TITLE GFXOFF), then the display is made as it was conceived - only on page 3. I don’t know how it can help, because the code _drawTitle and _drawHeader is almost the same.
  23. Table widget has a problem - when changing the Page of Tabs, the Table does not update completely. I have now made a workaround. I detect an event from the page and call the Table update function that I had to add. The second problem is rendering the Table on Page1, although the parent is specified as Page3. When rendered by an event from Page3, the Table is displayed on Page3. It looks like this. The program starts and displays Tabs and Page1 "Main states" with Table. I select the Page3 "Results" tab and see Table. Then I select the Page1 "Main states" tab without Table. How to solve this problem?
×
×
  • Create New...