How to Add an Icon into an Entry in GTK#? - gtk#

How to add primary and secondary icon to an Entry in GTK#? I can't find some method like Entry.setIconFromStock(EntryIconPosition, Stock) in java-gnome.

You should write set_icon_from_stock instead of setIconFromStock.
Here is a sample :
entry = gtk.Entry()
entry.set_icon_from_stock(1, gtk.STOCK_FIND)

You can't.
Icons in entries were supported starting in GTK 2.16. As you can see on the GTK language bindings page, the C# binding only supports up to 2.12.

Related

XCode: Additional localization of only one button

After a long long time, I added another button to my apps dialog. I had localized strings implemented. So I found a similar one like
/* Class = "NSButtonCell"; title = "Keep number"; ObjectID = "2yE-rM-5Sn"; */
"2yE-rM-5Sn.title" = "Nicht umnumerieren";
in file "Main.strings (German)". Unfortunately I forget, how I got there. I did the entire translation in one step in one night. Now I only need to get one new translation for the newly added button.
Any hint how to do this?
Select your project name (1.), in my case Timebooking. Maybe the application is selected instead in Targets and you have more options but not localization. Then select Use Base Localization (2.). It should create the English Main.strings file when you add English. There you can add the proper translation. HTH.

How to add a user defined control to a form in VFP

Hi: I have created a very simple user defined control (a container) with the visual IDE of Visual Foxpro 9 and stored it into a VCX file (sisweb.vcx)
After that I've created (visually) a form and in the INIT event I've tried to instantiate the previous container control and add to the form:
oContainer=newobject("xContainer","sisweb.vcx")
ThisForm.AddObject("Contx","oContainer")
ThisForm.Contx.Width=230
Unfortunatelly, when trying to ADD the container object, it rises an error saying that oContainer doesn't exists.
Can you help me please?
When you want to add an object dynamically at run-time, you could do something like
Thisform.NewObject("Contx", "xContainer", "sisweb.vcx")
Thisform.Contx.Width = 230
Thisform.Contx.Visible = .T.
Where assigning the Visible property explicitly is important.
On the other hand, you could also add it "visually" in the Designer by dragging it from the Project Manager's "Classes" tab, or by using the bookshelf icon of the Form / Class Designer's "Controls" toolbar, or the "Toolbox" in the "Tools" menu

Custom Control with Localization Support in WP7

I have created the DateTimePicker control. Now i want to add localization Support with this.
I have followed the below steps.
Created CustomControls.de-DE.resx inside the ResourceFolder.
added some commonly used strings in that resx file
changed the access modifier to Public
added <SupportedCulture>de-DE;</SupportedCulture> in the csproj file.
set System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de-DE"); in sample.cs file before
IntializeComponent().
my DateTimevalue was " 2 Day(s): 3 Hr (s): 5 Min(s) : 32 Sec (s)
Getting only default language that is english.
What i did wrong? Please help me anyone. Is anything i missed?
Clear Steps To add Localization Supports in WP7
Create Custom control.
Add AppResource.resx inside Properties
Add AppResource.es.resx and Appresource.it.resx files inside Properties
Add needed strings with unique name.(we can refer the strings use of this id).
Add it;es; in the csproj file.(unload the project, rightclick->edit, add the supportedculture
tag then reload it)
Create the Sample
do the same as 5th step for Sample.csproj file
Change the cultures of System in the button click.(Ex: Thread.CurrentThread.CurrentUICulture = new
System.Globalization.CultureInfo("de-DE");)
Run the Project
Ref: http://www.windowsphonegeek.com/articles/Localizing-a-Windows-Phone-app-Step-by-Step
Thankyou.

Navigating through widgets using the TAB key

What should I do in order to allow users to navigate through widgets using the Tab key (in either Gtk or any derivative like gtkmm, pyGtk)?
This is build into the default "key_press_event" signal handler. If you set your own handler you must return FALSE from this handler because a TRUE means you have handled the key and no further processing is done. You can use this to avoid the default tabbing.
And i would like to add a question here, because i have no idea how i can do the focus-next-widget, focus-prev-widget action programmatically.
Is tabbing through your controls not working? This should work out of the box as you build up your forms. To customize the order of moving through the widgets as you tab, you use the set_focus_chain methods: gtk, pygtk, gtkmm.

Allowing user selected Global Theme for winform app

I am using DevExpress controls in a winform app I am building for internal use. My app has about 30 forms in total and I am trying to figure out a way to allow my user's to select a theme. I have seen this mentioned here at SO multiple times in answers to other posts.
I understand how the StyleController works, I believe, but what I am wondering is how I can use 1 Style controller for the whole app.
Right now I am trying to create 1 StlyeController at the Shell form and then pass a reference to it to each child form. From there I then have to programatically set the StyleController property for each control. I don't mind I just wonder, especially from those who have done this, if there is a simpler way?
It is very simple. This example is assuming that you are using skins.
In the constructor of your main form calls:
DevExpress.Skins.SkinManager.EnableFormSkins();
This will enable your form to use the current skin. It is also important that each of your forms derived from XtraForm.
After that you need to setup the global look and feel object for your application:
//This set the style to use skin technology
DevExpress.LookAndFeel.UserLookAndFeel.Default.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Skin;
//Here we specify the skin to use by its name
DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Black");
If you want to set the look and feel of your application like Office 2003, the setup is different. You just have to call the following function:
DevExpress.LookAndFeel.UserLookAndFeel.Default.SetOffice2003Style();
So, every control of devexpress will use these settings to paint themselves. It is possible to specify a custom LookAndFeel object for some controls but I never used it because I dont see the point to have a custom display for a control or a form.
Exception:
There is one exception in Devexpress framework. The NavBarControl does not use the skin technology automatically from your global LookAndFeel object, you need to specify a setting to enable that:
//To use the current skin
youNavBarControl.PaintStyleName = "SkinNavigationPane";
//To use the current look and feel without the skin
youNavBarControl.PaintStyleName = "NavigationPane";
With version 11.2 I used the information in this article:
http://www.devexpress.com/Support/Center/p/K18013.aspx
In summary :
* Inherit all your forms from XtraForm
* Leave look and feel settings default so that they use the default skin
* Modify the default skin with the following line of code:
DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = "DevExpress Dark Style";

Resources