Search Results

Search results 1-20 of 68.

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Polygon Rotation

    LexaGb - - emWin related


    Yes, we could say that, I suppose. I would say, the term of the origin point is applicable when drawing the polygon. Rotation of the polygon is doing in relative coordinates. When we are drawing rotated polygon we set the origin point again for drawing it in right place. Alex.

  • Polygon Rotation

    LexaGb - - emWin related


    Hello, the coordinates of polygon are considered related to the origin point when drawing the polygon. When rotating the polygon the origin point is the pivot point of the polygon that can be inside and outside the polygon depending on its coordinates. Аfter rotation is done you can draw rotated polygon related to the new origin point. C Source Code (70 lines) Alex.

  • Dropdown widget issues

    LexaGb - - emWin related


    Hello, Quote from Electrons4me: “...I would have to draw all my primitives and text in the cbBackgroundWin() Callback... ” yes, that's right. If you are using widgets in your projects then you are using Window Manager and in this case you need to handle WM_PAINT message of the background window (desktop window in your case) and also draw all the additional graphics there. This is the way WM works and that is not only in emWin. WMs in Windows and other OS work the same way. Alex.

  • Hello, your question relates to the zooming capabilities of the GRAPH widget. Unfotunately the widget doesn't have such functions in the API list. It is works in mode "one pixel <-> one data point". So you need to draw it by yourself using user draw function. See description of the GRAPH_SetUserDraw() in the manual. Alex.

  • Hello, Mark, yes, GRAPH widget is not so easy, but when you get it about user draw function, you will able to draw a custom grid and manipulate the data to move the curves along the axes. Regarding the layers' contents: it's hard for me to say why the layer #0 data is visible together with the layer #1 data on your side. Just made a simple code with two layers (in simulation using SoftLayer feature). Layer #0 with a background window, layer #1 with a background window and main window with a memo…

  • Oh, I think it is just a little bug in the documentation . “Horizontal and vertical flags” make sense in case of text align related functions, probably this was copied from such function description or whatever and then the editor didn’t notice it to delete this phrase. Alex.

  • I'm using STemWin 5.44, so I don't have the sources and I can't see C-code where the states are OR-ed (except if look at assembler code). Can you see where it happens? However, calling MULTIPAGE_SetBitmapEx() with a mask instead of index doesn't change anything on my side. I thought when tabs' bitmaps are drawn the parameter MULTIPAGE_BI_... must be considered as an index value not as a mask... Alex.

  • Hello, for aligning the text to the right after the bitmap you can increase the width of the tabs using MULTIPAGE_SetTabWidth() and then set text align to the right using MULTIPAGE_SetTextAlign(). With regard to the bitmap, yes, looks strange. Adding a bitmap for unselected state draws it also in selected state of the tabs. Try to use skinning option of the widget and manually draw the bitmap in unselected state. Before doing this just comment "MULTIPAGE_SetBitmapEx()" line. C Source Code (21 li…

  • Hello, first you can just create a memory device (if your emWin package contains that option) filled with transparency. C Source Code (10 lines) Then you draw the curve lines into the memory device and copy its content to the screen in WM_PAINT. Memory device will keep the previous curve line C Source Code (16 lines) Just curious why GRAPH widget with XY data is no good for you... Alex.

  • Yes, GUI_MAKE_COLOR is doing its job, but if I assign the ARGB-image to the IMAGE widget then the image in GUIBuilder looks like red and blue are swapped . Alex.

  • Ok, Sven, thanks for clarifying, but one thing stops me from using ARGB. It is GUIBuilder that works in ABGR mode . So the colors look incorrectly. I got used to it for creating dialogs. Alex.

  • Hello, Sven, This appears in simulation v5.44 (GUISim.lib from SEGGER package) and on real hardware using STemWin v5.44 (STemWin_CM7_wc32_ot.a from ST package). I'm using ABGR mode (GUI_USE_ARGB is set to 0) so we don't need to clear "alpha byte" of the color value. "...GUI_GREEN & ~0xFF000000..." didn't change anything on my side. If I comment GUI_EnableAlpha(0) transparency is not lost (understandably) and of course it would slow down the system. upd: on the hardware driver is GUIDRV_LIN_16, c…

  • Hello, WM_GetUserData()/WM_SetUserData() is for simple windows. For widgets just use specific <WIDGET>_GetUserData()/<WIDGET>_SetUserData() functions. In your case it is BUTTON_SetUserData(). Calling WM_SetUserData() for the button may have caused button-specific parameters to overwrite. Alex.

  • Hello, maybe we should place two scales (gray and colored) at one position in an exact matching using IMAGE widgets. Then invalidate colored bar image within the area related to the bar value using WM_SetUserClipRect() function. Just a simple code: C Source Code (85 lines)Alex.

  • Hello to everyone, I have a question implementing a listwheel with semitransparent rounded rect as a background. Here is the code for 320 * 240 desktop: C Source Code (62 lines)All is ok until listwheel reacts on moving. Then it loses transparency. It is solved with using a memory device: C Source Code (73 lines)Now all is ok. But why it is not working when drawing "on the run"? Thanks, Alex.

  • Hello, to awneil's link I would add the latest package for STM32H7 that contains a later version 5.44: Unfortunately, STM32CubeMX doesn't contain code generation scripts with STemWin GUI for STM32H7 so far. So you need to configure it by yourself. Alex.

  • Fixed widget for all windows

    LexaGb - - emWin related


    Hello, three ways come to mind: 1. Placing your fixed widgets in one of the windows (also in GUIBuilder). When you go to the other page (if using MULTIPAGE widget) or just change a window then you can reattach these fixed widgets to the new selected window using WM_AttachWindow()/WM_AttachWindowAt(). 2. Placing fixed widgets in a separate window that is always visible. 3. Multilayer can be used. Then you just place fixed widgets in a different layer so that these widgets always could be visible …

  • Hello, Sven, ok, thanks for clarifying. Alex.

  • Hello to everyone, I'm trying to implement a simple knob using memory devices containing transparency. Memory device for the knob is displayed correctly whereas memory device for the background loses its transparency. When checking data at the background device transparency is present. Here is the code (screen size 320*240) and screenshots: C Source Code (87 lines)…285d78ef6279015c57d20f515 Expecting to see the following:…285d78ef62790…

  • Works on my side, at first glance, in simulation version 5.44. Maybe additional code from your project affects the text visibility. Your new code using TEXT widgets instead of drawing text in WM_PAINT of the dialog. This updates the contains of the TEXT widgets in their WM_PAINTs when invalidating the dialog and its child widgets, and all the text drawing functions are called from the right places. Thus you can see the text in your dialog. Alex.