本文整理汇总了C#中Gtk.Entry.ModifyFont方法的典型用法代码示例。如果您正苦于以下问题:C# Entry.ModifyFont方法的具体用法?C# Entry.ModifyFont怎么用?C# Entry.ModifyFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Entry
的用法示例。
在下文中一共展示了Entry.ModifyFont方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SimpleTextTool
public SimpleTextTool (IDrawingEditor editor, SimpleTextFigure fig, ITool dt)
: base (editor, fig, dt) {
_entry = new Gtk.Entry ();
_entry.HasFrame = false;
_entry.Alignment = 0.5f;
_entry.Changed += new System.EventHandler (ChangedHandler);
_entry.ModifyFont (fig.PangoLayout.FontDescription.Copy ());
}
示例2: FetchForm
public static void FetchForm(Container Parent, XmlNode Nodes)
{
int cIndex = 0;
string[] UFont;
XmlNodeList original = Nodes.ChildNodes;
XmlNodeList reverse = new ReverseXmlList(original);
foreach (XmlNode C in reverse) {
if (C.Name == "Object") {
cIndex++;
if (C.Attributes[0].Name == "type") {
if (C.Attributes["type"].Value.StartsWith("System.Windows.Forms.PictureBox") || C.Attributes["type"].Value.StartsWith("System.Windows.Forms.Button")) {
var PB = new Gtk.Button();
global::Gtk.Fixed.FixedChild PBC1 = ((global::Gtk.Fixed.FixedChild)(Parent[PB]));
Parent.Add(PB);
foreach (XmlNode V in C.ChildNodes) {
if (V.Name == "Property") {
switch (V.Attributes["name"].Value) {
case "BorderStyle":
if (V.InnerText == "Solid") {
//PB.ModifierStyle =
}
break;
case "Name":
PB.Name = V.InnerText;
break;
case "ForeColor":
var FColor = V.InnerText.GetXColor().ToNative();
PB.Children[0].ModifyFg(StateType.Normal, FColor);
PB.Children[0].ModifyFg(StateType.Active, FColor);
PB.Children[0].ModifyFg(StateType.Prelight, FColor);
PB.Children[0].ModifyFg(StateType.Selected, FColor);
break;
case "Caption":
case "Text":
PB.Label = global::Mono.Unix.Catalog.GetString(System.Environment.ExpandEnvironmentVariables(V.InnerText).Replace("%DATE%", System.DateTime.Now.ToString("dd.MM.yyyy")).Replace("%TIME%", System.DateTime.Now.ToString("hh:mm:ss")));
break;
case "BackColor":
var BColor = V.InnerText.GetXColor().ToNative();
PB.ModifyBg(StateType.Normal, BColor);
PB.ModifyBg(StateType.Active, BColor);
PB.ModifyBg(StateType.Insensitive, BColor);
PB.ModifyBg(StateType.Prelight, BColor);
PB.ModifyBg(StateType.Selected, BColor);
break;
case "SizeMode":
//PB.SizeMode = Enum.Parse(typeof(PictureBoxSizeMode), V.InnerText);
break;
case "Location":
PBC1.X = (int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX);
PBC1.Y = (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY);
break;
case "Size":
PB.SetSizeRequest((int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX), (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY));
break;
case "Font":
string VC = V.InnerText;
UFont = VC.Replace("style=", "").Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries);
string VCFName = UFont[0];
float VCSize = float.Parse(UFont[1].Replace("pt", ""));
float Z = (float)(VCSize * App.ScaleFactorY);
PB.Children[0].ModifyFont(Pango.FontDescription.FromString(VCFName + " " + ((int)Z).ToString()));
break;
case "Image":
if (V.HasChildNodes) {
string IMGData = V.FirstChild.InnerText;
byte[] B = System.Convert.FromBase64String(IMGData);
Pixbuf P = new Pixbuf(B);
P=P.ScaleSimple(PB.WidthRequest-10, PB.HeightRequest, InterpType.Bilinear);
PB.Image = new Gtk.Image(P);
}
break;
}
} else if (V.Name == "Object") {
//FetchForm(PB, V.ParentNode);
}
}
} else if (C.Attributes["type"].Value.StartsWith("System.Windows.Forms.Label")) {
var CE = new Gtk.EventBox();
CE.ResizeMode = ResizeMode.Parent;
var CC = new Gtk.Label();
CE.Add(CC);
Parent.Add(CE);
CC.LineWrapMode = Pango.WrapMode.Word;
CC.LineWrap = true;
CC.Wrap = true;
CC.Justify = Justification.Fill;
global::Gtk.Fixed.FixedChild PBC1;
if ((Parent[CE]).GetType().ToString() == "Gtk.Container+ContainerChild") {
var XVC = Parent[CE].Parent.Parent;
PBC1 = (global::Gtk.Fixed.FixedChild)(Parent[XVC]);
} else {
PBC1 = ((global::Gtk.Fixed.FixedChild)(Parent[CE]));
}
foreach (XmlNode V in C.ChildNodes) {
if (V.Name == "Property") {
switch (V.Attributes["name"].Value) {
case "BorderStyle":
if (V.InnerText == "Solid") {
//PB.ModifierStyle =
//.........这里部分代码省略.........