I have coded a custom keyboard on CF 35. , Windows CE 6.0 .
It is created and added to form on BaseForm and all forms inherit from this one.
So my problem is : custom keyboard takes 1-2 second to be created and located on every form load.
how can i get solve this?
Here is the Constructor of Keyboard
public KeyBoard()
{
InitializeComponent();
panelNumeric.SendToBack();
panelNumeric.Visible = false;
this.Visible = false;
//Click event
for (int i = 0; i < this.Controls.Count; i++)
this.Controls[i].Click += new EventHandler(ButtonClick);
panelNumeric.Click -= ButtonClick;
for (int i = 0; i < panelNumeric.Controls.Count; i++)
panelNumeric.Controls[i].Click += new EventHandler(ButtonClick);
//Caps Lock
btnListForCaps = new List<Control>(){btnQ,btnW,btnE,btnR,btnT,btnY,btnU,btnI,btnO,btnP,btnP,btnTRG,btnTRU,btnA,btnS,btnD,btnF,btnG,btnH,btnJ,btnK,btnL,btnTRS,btnTRI,btnZ,btnX,btnC,btnV,btnB,btnN,btnM,btnTRO,btnTRC};ButtonClick(btnShift, null);
}
i found the solution.
i added a new form and locate keyboard buttons on it.
Create keyboard form on application load and declare it as a static global variable.
Call "GlobalParameters.Keyboard.CustomShow();" on each form i need.
hope it helps
Related
I am new in ArcGis. I came across a requirement that I need a command on the ArcGis Toolbar. On click the command, a Windows Form will open and there one region selector button is there. upon clicking on the button, the current Form UI must be minimized and the user will be allowed to draw a polygon. Can you please help on how to do that. Here is the code. I took normal windows button and wrote the below code in the click event.
_application = ((IApplication)_hookHelper.Hook);
IMxDocument pMxDoc = (IMxDocument)_application.Document;
IMap pMap = (IMap)pMxDoc.FocusMap;
IActiveView pActiveView = (IActiveView)pMap;
if (pActiveView == null)
{
return;
}
//// Changing the state of the Window.
if (this.WindowState == FormWindowState.Normal || this.WindowState == FormWindowState.Maximized)
{
this.WindowState = FormWindowState.Minimized;
// this.Hide();
}
ESRI.ArcGIS.Display.IScreenDisplay screenDisplay = pActiveView.ScreenDisplay;
// Constant
screenDisplay.StartDrawing(screenDisplay.hDC, (System.Int16)ESRI.ArcGIS.Display.esriScreenCache.esriNoScreenCache); // Explicit Cast
ESRI.ArcGIS.Display.IRgbColor rgbColor = new ESRI.ArcGIS.Display.RgbColorClass();
rgbColor.Blue = 111;
ESRI.ArcGIS.Display.IColor color = rgbColor; // Implicit Cast
ESRI.ArcGIS.Display.ISimpleFillSymbol simpleFillSymbol = new ESRI.ArcGIS.Display.SimpleFillSymbolClass();
simpleFillSymbol.Color = color;
ESRI.ArcGIS.Display.ISymbol symbol = simpleFillSymbol as ESRI.ArcGIS.Display.ISymbol; // Dynamic Cast
ESRI.ArcGIS.Display.IRubberBand rubberBand = new ESRI.ArcGIS.Display.RubberRectangularPolygonClass();
// ESRI.ArcGIS.Display.IRubberBand rubberBand = new ESRI.ArcGIS.Display.RubberPolygonClass();
ESRI.ArcGIS.Geometry.IGeometry geometry = rubberBand.TrackNew(screenDisplay, symbol);
screenDisplay.SetSymbol(symbol);
screenDisplay.DrawPolygon(geometry);
screenDisplay.FinishDrawing();
I am also not getting any mouse event and the UI is not minimized while starting drawing the polygon. Can anyone please help.
Have we check the white paper for ArcGIS runtime SDK for .Net?
http://resources.arcgis.com/en/help/runtime-wpf/concepts/index.html#/Essential_vocabulary/01700000004z000000/
Heading ##I have a login page in my one of the pages in settings flyout.I have used this code(windows 8.1)
int flyoutOffset = 0;
Windows.UI.ViewManagement.InputPane.GetForCurrentView().Showing += (s, args) = > {
args.EnsuredFocusedElementInView = true;
settingsPopup.VerticalOffset = 0;
flyoutOffset = (int) args.OccludedRect.Height;
settingsPopup.VerticalOffset -= flyoutOffset;
};
If I use this the top top text box is scrolled up and not visible.,I need to make all the controls in the flyout to be visible. Could you please help how to fix this?Thanks in Advance
I've a method which fill a combobox. (compact framework 3.5)
lstNiveaux.BeginUpdate();
lstNiveaux.Items.Clear();
for (int i = 0; i < list.Count; i++)
{
var item = new ListViewItem(list[i].value);
lstNiveaux.Items.Add(item);
}
lstNiveaux.EndUpdate();
I want to do :
lstNiveaux.Items[10].Selected = true;
lstNiveaux.EnsureVisible(10);
When I write that piece of code at the end of the previous method, it won't work but ... if I put a button with a click event, and the piece of code inside, it will work.
I tryied Application.DoEvents, Thread.Sleep and other stuff but no work. Does someone has a solution ?
regards
I'm trying to create new GTK Notebook tabs that contain both a name (as a Label) and a close button (as a Button with an Image) with the following code:
Label headerLabel = new Label();
headerLabel.Text = "Header";
HBox headerBox = new HBox();
Button closeBtn = new Button();
Image closeImg = new Image(Stock.Close, IconSize.Menu);
closeBtn.Image = closeImg;
closeBtn.Relief = ReliefStyle.None;
headerBox.Add(headerLabel);
headerBox.Add(closeBtn);
headerBox.ShowAll();
MyNotebook.AppendPage(childWidget, headerBox);
This seems to work just fine; however, the button is about 1.5 - 2 times the size is needs to be, so there is a lot of extra space around the image inside the button. Having looked at remove inner border on gtk.Button I now see that the culprit is the "inner-border" style property of the GtkButton, but (being new to GTK) I can't seem to figure out how to override its value.
Is there some method of doing this that I'm missing? I don't have any reservations about not using a Button/Image combination, so any more obvious suggestions are welcome.
Note: I have seen the suggestion in the linked question to use an EventBox, but I was not able to add the Relief and mouseover effects to that Widget.
You are in luck. I just made the exact same thing yesterday, and can fortunately give you some code. The trick is to create a Custom Tab Widget.
public class MultiTab : Gtk.Box
{
public Gtk.Label Caption;
Gtk.Image img = new Gtk.Image(Platform.IMG + "tab_close.ico");
public Gtk.ToolButton Close;
public Gtk.Notebook _parent;
public MultiTab ( string name )
{
CreateUI(name);
}
public MultiTab(string name, Gtk.Notebook parent)
{
_parent = parent;
CreateUI(name);
CreateHandlers();
}
void CreateUI(string name)
{
Caption = new Gtk.Label(name);
Close = new Gtk.ToolButton(img,"");
PackStart( Caption );
PackStart( Close );
ShowAll();
Close.Hide();
}
void CreateHandlers()
{
Close.Clicked += delegate {
_parent.RemovePage(_parent.CurrentPage);
};
}
public bool Active;
}
Next all you have to do is use this widget(or a similar one created by you) in Gtk.Notebook like this:
MyNoteBook.AppendPage(new <YourPage>(), new MultiTab("<your caption>",this));
And You're done.
Here is a screenshot:
Add this:
RcStyle rcStyle = new RcStyle ();
rcStyle.Xthickness = 0;
rcStyle.Ythickness = 0;
closeBtn.ModifyStyle (rcStyle);
Add items to box using Gtk.Box.PackStart/PackEnd methods rather than generic Gtk.Container.Add method. PackStart/PackEnd will allow you control how child widgets will be allocated space:
headerBox.PackStart (headerLabel, true, true, 0);
headerBox.PackEnd (closeBtn, false, false, 0);
Using javascript, I am trying to change the selection of the listbox item like this:
function selectFirstActiveListItem(oListBox)
{
for (var i = 0; i < oListBox.options.length; i++)
{
oListBox.selectedIndex = i;
var szStatus = GetDomboBoxItemAttribute("Status", m_pdocConnectType.getXMLDOM(), oListBox);
if ("Enabled" == szStatus)
return;
}
oListBox.selectedIndex = 0;
}
Though the index correctly changes at the background, but it is not reflected on the UI. The listbox still shows the old selection.
What's going wrong?
try this instead:
oListBox.options[i].selected = true;
Oops! That was working and showing the correct result. My take on the behavior was incorrect there.