how to specify the gtk+ combobox position popup - c

I use glade and GTK to design the interface of my application.
My question is about the position of the popup associated with a GtkComboBox.
My popup appears horizontally under the GtkComboBox but vertically centered.
Gnome Developper says "The style in which the selected value is displayed, and the style of the popup is determined by the current theme".
How can I know that theme and where I can fix it for a popup.
I have noticed that from fresh start (power up) the popup in glade is attached to the ComboBox.
It is only after starting my application that the issue of vertically centered popup appears. It appears in the app, but also in glade itself!
I don't have the faintest idea on where to search for the issue.
Pierre

I found the cause of the issue.
Not GTK+ nor my application SW.
I use a SW keyboard and it is it which modify the windows current theme!
Why I don't know. But clearly the issue appears when this keyboard is on the screen.
It is "matchbox-keyboard".

Related

What should I implement for a small popup control in a VSTO project?

In my VSTO projects (Office 2007 / 2010) I would like to use a small popup control (think Tooltip like features; fade animation and mouse interaction).
I would prefer to use WPF. If I were to do this in WPF I would create a custom Popup Control.
In VSTO, as far as I understand it, I must use a WPF window and then have 2 options, either I put this window in a Windows Form Container or I get the Hwnd of my office app and I add this Hwnd to the Owner property of a WPF Window. Am I correct here?
Creating a whole window, animating it on and off the screen etc to look like a ToolTip seems to be overkill.
So my question is how should I do this. I would prefer WPF.
I don't know if this would work but my first thought is to build a very tiny WPF window which is transparent and start it with the Office App. I can then build a Popup Control (which is a child of this tiny window) which I show and not show at a mouse position. Pretty sure a popup can appear outside the bounds of its parent window.
Just wanted to tidy up my own question with what I did. In the VSTO addin project I added a reference to WindowsBase, PresentationFramework and presentation core.
And then I just follow any tutorial or example that adds a WPF Popup. By popup I mean a System.Windows.Controls.Primitives.Popup. For the Placement I used PlacementMode.Absolute and then used a window point to set its position.
This pretty much answers my question. Of course this popup is literally floating above your office window so you will need to make sure that you control it for example if the office window moves, is minimized and the like.

Is there a SurfacePopup control in Surface 2?

We've been working on an application for the last few months that's aimed at Windows 7 tablet PCs. So we've used the Surface 2 SDK for most controls and it's all touch-happy.
I have noticed recently, though, that one of our custom controls isn't working as it should. This control provides popout menus, and these are achieved through the Popup control. On a developer's laptop, this works fine and the menus vanish when you click away from them. I've noticed, though, that on our test tablet they have a tendency to stay open.
I found that there was a SurfacePopup in the first Surface SDK, but I can't find one in the Surface 2 SDK. Did they get rid of it? Is there a 'best practice' approach?
If there's no simple solution, I may have to go old-school and add a window-sized hidden SurfaceButton below the menu when it appears, that hides itself and the menu when clicked or touched.
Beyond that I've noticed that sometimes the SurfaceScrollViewer within the popups won't work. I'm guessing this is because it's not picking up touch events properly. I tried adding this extension method to the window..
this.EnableSurfaceInput();
..but I get a NullReferenceException on System.Windows.Input.Mouse.get_LeftButton() which bizarrely suggests that it can only enable surface inputs for controls when there's a mouse plugged in.
Any ideas? They'll all be welcomed with open arms!
There's no SurfacePopup in the Surface SDK 2.0, however you can use a normal WPF popup. Then you need to make sure that it receives Touch Events by using the extension method you suggested above on the popup, not the window:
((HwndSource)HwndSource.FromVisual(popup)).EnableSurfaceInput();
Edit: As I just found out, this only works when the popup is initially open. To get it to work when the popup is opened later on, you don't need to use the popup, but the parent of it's child (see this question).
For the benefit of Daniel, and anyone else who needs a solution to this, I'll try to cast my mind back two years and explain how we got this working.
As far as I can remember, the answer was to use an adorner layer instead of a popup. Basically, every WPF control has an adorner layer, which sits above the control's UI stack. By default it contains nothing, but you can add whatever you like to it.
I got this all working by writing a custom control that allows you to place that control, with content, in the XAML and then show and hide it whenever you need to. When it's shown, it moves its contents into the adorner layer of the containing window, and when it's hidden it moves the contents back into the control itself, which is hidden from the user.
Afraid I can't go into any more detail than that, but as far as I can remember this was the ultimate solution; replacing popups (which never quite worked very well) with a custom control that uses the adorner layer.
Hope that helps!

how to change the wpf window's icon size?

I would like to change the size of the window's icon in the xaml window.
I know that I can hide the window's title bar and create a custom title bar, but is there
any way to change the icon size alone ?
I was looking for many forums and couldnt find a proper solution.
How do I change WPF Menu's icon column size?
The above link explains for menu's icon size but I want for the window's icon
The standard window chrome is handled by the Windows.
I guess the reason for that is consistency across applications which is also the reason why I dislike the Office/Ribbon replacement of the standard chrome.
In Windows 8 Metro applications there will be no window chrome so all UI will be up to you.
In Windows 8 desktop applications (and Windows 7 applications) you will need to replace the entire chrome completely.
To save yourself some coding time, check out this solution over at CodePlex:
http://wpfwindow.codeplex.com/

Image Icons like Macbook in WPF

I am looking for very simple UI; with three Image Icons on Bottom of the screen. And when user hovers over that Image Icon it pops out and come bigger then normal size when no mouse over the Image.
Exactly like Mac where they have list of Icons on the bottom and when you hover over one Icon it stands out and when you click on it it opens respective application...
How can I do this in WPF C# ?
Or if you can direct me to existing example/code etc ?
Thanks
You are looking for Fish Eye Effect in WPF.
Here is a good article from CodeProject:
FishEyePanel/FanPanel - Examples of custom layout panels in WPF
I wrote this user control that would mimic the dashboard of the Mac's (Fish eye effect).

WPF tooltip displayed on top of other window?

Sometimes (I didn't figure the exact scenario), WPF tooltips are displayed on top of other windows, even when the app window is completely hidden. Clicking on the other window doesn't make it disappear.
Is anyone familiar with this?
Regards,
Yaakov
I've seen this as well.
If you have a wpf tooltip open, and you Alt-Tab to another application, the wpf tooltip stays visible, even though the wpf application itself is not.
You could programmatically close the tooltip when your wpf app is no longer active.

Resources