EFL - custom button - efl

I'm porting a C-language kiosk application to a x86 machine, running Ubuntu 16.
I'm using the EFL GUI framework (version 1.20.7) - it is new to me.
I managed to add an icon to a button, but the button still has a frame and the 'pressed' GUI animation.
I want only my custom-button-image to be visible, possibly switching between 2 images: 'pressed' and 'unpressed' (upon matching events, of by configuration... maybe edge???).
I don't mind using any widget (image, etc.), if it has the callbacks for relevant events.
Thanks.

Rather than using a button object which has a standard theme you could just use an image (evas_object_image_add) and change the image on mouse down/up (evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN, ...)).
You should note the difference between evas_ and elm_ namespaces - elm (the toolkit) has a standard theme and evas (the render library) is a "blank canvas" :). An Evas Object can be added to the UI just like any other Elm widget.

Related

Simple GUI library for basic GLUT CAD application?

I want to create a very simple CAD application written with GLUT library. I just need this to create simple dice editor application for computer graphics class, so an easy-to-use GUI library that supported GLUT is what I basically need for this project. I stumble upon GLUI, but it doesn't have widgets such as color chooser or file loader dialog. Is there a suitable GUI library for GLUT that I can use?
There are gui libraries like Qt or FLKT, but they have their own main loop.
on windows you should call directly the native files dialogs GetOpenFileName() and GetSaveFileName(). If you want a cross platform solution and to exactly answer the question, yes there is "a suitable GUI library for GLUT that (you) can use": look for tiny file dialogs on sourceforge it even has a color chooser and has no main loop.
You want a simple GUI library yet you want it to have advanced features.
Open File Dialog
Depending on what OS you want it to be running on you can pop up the OS specific file opening dialog. It does not have to be shown inside of the application window. Instead let it pop a new window with the OS file open dialog.
Color Chooser
Implementation of a simple Color Picker widget is not that hard really. Three sliders for RGB and a box to show the color chosen.
You can also use the OS (Windows) specific color picker. And skip the implementation inside you app altogether.

WinRT Settings Charm. Elements overlayed by on screen keyboard

I'm developing for Windows 8 (WInRT) and have problem with settings charm. Settings popup is based on Microsoft SDK settings charm. Settings panel is Popup. Content is wrapped by ScrollViewer -> Grid -> StackPanel. In StackPanel I have input fields. when I trying to fill last of them on screen keyboard overlaying it and I cant see field and cant scroll to it. Is there any way to see it and to scroll to it automatically?
Seems like the popups on Windows 8 suffer from the same problem as they did on Windows Phone in that when you put a TextBox on one of them - it does not get pushed up together with all the other content as it does when it is not in a popup.
My solution to that would be to not use popup for input fields and instead go for a layout that you can manage yourself.
By default the app has a Frame control at its visual root. You can modify it for example by putting your own UserControl in there (I usually call it AppShell) which has the Frame used by all pages, you can have a layer for popups, log in screens, the extended splash screen etc.
To solve your problem you would need to put your charm's UI inside of such layer instead of in a popup. Then the build-in mechanism that pushes all the UI up when the on-screen keyboard would otherwise obstruct the view of your TextBox should just start working again.
*EDIT
A simpler solution might be to make sure your settings panel popup is parented in your visual tree - e.g. by adding it as a child element to a root grid of your app or page. It turns out that in that case its content does get pushed up when the OSK shows up.
Take a look at this post
It's a popup wrapper (turns user controls into popups) that takes care of the keyboard appearing and adjusts the size of the popup (and thus the user control) accordingly.

Animate Windows Wallpaper with QT

i want to make an animated wallpaper for windows. So far i have only expreience with Mac OS X programming and i'm new to windows. So i decided to work with QT because it seems that there is more help out there.
Until now i have created the app in a borderless window in qt. It work quiet fine.
But is there a way in QT to change the level of the window so that its appear above the windows wallpaper but behind the icons?
EDIT:
Ok if found a simple solution.
After some testing with the hints form kusg1 I figured out when there is a transparent window mouse events going still to the desktop.
I actualy want have this website has wallpaper: Ticketack. - So i created a frameless window which stays on bottom and has a transparent background and displays the text. Beside this i can change the windows wallpaper directly to get the background of the clock.
So clock text is not behind the icons but i think this will be ok.
Just some ideas: Use the windows flag as Qt::Window | Qt::FramelessWindowHint + Windows Stay at bottom hint, and set the content of the widget with your animated content (the suitable candidate is to use QGraphicsView).
The widget needs two main tasks:
Upon launching, it grabs the desktop background as pixmap and do overlay with the animated content (this needs to have the desktop to be wallpaper-less for simple scenario).
The widget needs to capture mouse and focus event and channel back to actual window command if the user wants to click the icon on the desktop.
Update:
Some pointers for the implementation:
For managing desktop icon, there is a good article here! (also found from SO).
Qt example and demos has an example on the taking desktop snapshot, the snippet is: QPixmap::grabWindow(QApplication::desktop()->winId());
Answer to your question: no, there isn't.
However, you can try something like this using Windows API: How to draw directly on the Windows desktop, C#?

wxpython AUI panels dockable but not floatable

I'm having some undesired behavior with movable panels in wxpython. I'm using the wxpython Cocoa build 2.9.2.3 for Python 2.7 on Mac OS X 10.6.7. I'm importing wx.aui and trying to create dockable panels.
I have a panel that I've created a wx.aui.AuiManager on and have added two panels, one on top and one on below. For both of them I have disabled the close button. Right now, the panels can be dragged into different dockable positions on the frame or off of the frame to create a floating window. This window shows up as the Mac native MiniFrame with a disabled close button. I do not want users to be able to separate the panels from the main frame.
I have passed .Floatable(False) to each pane's PaneInfo, but this won't allow the panels to be moved around at all, even if I pass a .Dockable(True)
Can I have panes in AUI that are dockable and movable, but not floatable?
I don't know if there's a way to do that or not. It may be a limitation of wx.aui. You should ask on the wxPython mailing list. Or you could try the mostly drop-in replacement: wx.agw.aui (http://xoomer.virgilio.it/infinity77/AGW_Docs/aui_module.html#aui). It fixes a bunch of bugs in the default wx.aui and is written in pure Python.

How does a Windows non-native user interface work?

Through experience I have found that the native windows forms/components don’t like to be changed. I know using Delphi or Visual Studio you are given native windows components to populate a form or window with and then you attach code on events that these components may do (onClick for example).
However, how do all of these programs like Word or google’s Chrome browser alter the standard windows’ window? I thought it was somehow protected?
Chrome seems to have tabs actually on the window’s frame?
I know you can also get toolkits like Swing and QT that have their own controls/components to populate a form. How do these work? (How does the operating system/computer know what a non-native button should act like? For example; Chrome's back and forward buttons, they're not native components?).
I can understand how OpenGL/DirectX window would work because you’re telling the computer exactly what to draw with polygons/quads.
I hope this question is clear!
Windows does not protect GUI elements. Windows and controls can be subclassed to handle various drawing operations in a custom way. For example, windows may override and reimplement the handling of the WM_NCPAINT message to draw a custom titlebar and frame:
http://msdn.microsoft.com/en-us/library/dd145212(VS.85).aspx
Some Windows controls have an "owner-draw" mode. If you use this, you get to draw the control (or at least vital parts of the control), while Windows takes care of responding to user input in the standard way.
Swing ant QT draw their own widgets at a low level using basic primitives, but they also have theme engines which can mimic the native controls.
Qt moved to native controls a while back. As for how swing does it, it gets a basic window from the OS. Then much like Opengl\Directx it does all of the drawing with in that window. As for where to position things that is what the layout managers do. Each manager has a layout style horizontal, vertical, grid, components it has to draw and a section of window it is expected to fill. From there it does some pretty easy math to allocate its space to its controls.
There's no magic: non native controls are simply drawn on a blank window. Or, instead of being drawn they may be represented as one of several bitmaps based on state (ie: a button may be represented as a .png for the normal state, another .png for the pressed state, etc)

Resources