本文整理汇总了C#中Gtk.HBox类的典型用法代码示例。如果您正苦于以下问题:C# HBox类的具体用法?C# HBox怎么用?C# HBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HBox类属于Gtk命名空间,在下文中一共展示了HBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsightWindow
public InsightWindow(SourceEditorView control, Project project, string fileName)
: base(WindowType.Popup)
{
this.control = control;
this.fileName = fileName;
this.project = project;
/*System.Drawing.Point caretPos = control.ActiveTextAreaControl.TextArea.Caret.Position;
System.Drawing.Point visualPos = new System.Drawing.Point(control.ActiveTextAreaControl.TextArea.TextView.GetDrawingXPos(caretPos.Y, caretPos.X) + control.ActiveTextAreaControl.TextArea.TextView.DrawingPosition.X,
(int)((1 + caretPos.Y) * control.ActiveTextAreaControl.TextArea.TextView.FontHeight) - control.ActiveTextAreaControl.TextArea.VirtualTop.Y - 1 + control.ActiveTextAreaControl.TextArea.TextView.DrawingPosition.Y);*/
//control.ActiveTextAreaControl.Caret.PositionChanged += new EventHandler(CaretOffsetChanged);
// control.TextAreaPainter.IHaveTheFocusChanged += focusEventHandler;
AddEvents ((int) (Gdk.EventMask.KeyPressMask));
this.SkipPagerHint = true;
this.SkipTaskbarHint = true;
this.Decorated = false;
this.BorderWidth = 2;
this.TypeHint = Gdk.WindowTypeHint.Dialog;
desc = new Gtk.Label ("");
current = new Gtk.Label ("");
max = new Gtk.Label ("");
HBox mainBox = new HBox (false, 2);
mainBox.PackStart (new Gtk.Image (Gtk.Stock.GotoTop, Gtk.IconSize.Menu), false, false, 2);
mainBox.PackStart (current, false, false, 2);
mainBox.PackStart (new Gtk.Label (" of "), false, false, 2);
mainBox.PackStart (max, false, false, 2);
mainBox.PackStart (new Gtk.Image (Gtk.Stock.GotoBottom, Gtk.IconSize.Menu), false, false, 2);
mainBox.PackStart (desc);
Gtk.Frame framer = new Gtk.Frame ();
framer.Add (mainBox);
this.Add (framer);
}
示例2: DockToolbarFrame
public DockToolbarFrame ()
{
vbox = new VBox ();
Add (vbox);
DockToolbarPanel topPanel = new DockToolbarPanel (this, Placement.Top);
DockToolbarPanel bottomPanel = new DockToolbarPanel (this, Placement.Bottom);
DockToolbarPanel leftPanel = new DockToolbarPanel (this, Placement.Left);
DockToolbarPanel rightPanel = new DockToolbarPanel (this, Placement.Right);
panels = new DockToolbarPanel [4];
panels [(int)Placement.Top] = topPanel;
panels [(int)Placement.Bottom] = bottomPanel;
panels [(int)Placement.Left] = leftPanel;
panels [(int)Placement.Right] = rightPanel;
vbox.PackStart (topPanel, false, false, 0);
HBox hbox = new HBox ();
contentBox = new VBox ();
hbox.PackStart (leftPanel, false, false, 0);
hbox.PackStart (contentBox, true, true, 0);
hbox.PackStart (rightPanel, false, false, 0);
vbox.PackStart (hbox, true, true, 0);
vbox.PackStart (bottomPanel, false, false, 0);
this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask;
ShowAll ();
}
示例3: CanvasExample
public CanvasExample () {
Gtk.Window win = new Gtk.Window ("Canvas example");
win.DeleteEvent += new DeleteEventHandler (Window_Delete);
VBox vbox = new VBox (false, 0);
win.Add (vbox);
vbox.PackStart (new Label ("Drag - move object.\n" +
"Double click - change color\n" +
"Right click - delete object"),
false, false, 0);
canvas = new Canvas ();
canvas.SetSizeRequest (width, height);
canvas.SetScrollRegion (0.0, 0.0, (double) width, (double) height);
vbox.PackStart (canvas, false, false, 0);
HBox hbox = new HBox (false, 0);
vbox.PackStart (hbox, false, false, 0);
Button add_button = new Button ("Add an object");
add_button.Clicked += new EventHandler (AddObject);
hbox.PackStart (add_button, false, false, 0);
Button quit_button = new Button ("Quit");
quit_button.Clicked += new EventHandler (Quit);
hbox.PackStart (quit_button, false, false, 0);
win.ShowAll ();
}
示例4: AboutPintaTabPage
public AboutPintaTabPage()
{
Label label = new Label ();
label.Markup = String.Format (
"<b>{0}</b>\n {1}",
Catalog.GetString ("Version"),
"1.2");
HBox hBoxVersion = new HBox ();
hBoxVersion.PackStart (label, false, false, 5);
this.PackStart (hBoxVersion, false, true, 0);
label = null;
label = new Label ();
label.Markup = string.Format ("<b>{0}</b>\n {1}", Catalog.GetString ("License"), Catalog.GetString ("Released under the MIT X11 License."));
HBox hBoxLicense = new HBox ();
hBoxLicense.PackStart (label, false, false, 5);
this.PackStart (hBoxLicense, false, true, 5);
label = null;
label = new Label ();
label.Markup = string.Format ("<b>{0}</b>\n (c) 2010-2011 {1}", Catalog.GetString ("Copyright"), Catalog.GetString ("by Pinta contributors"));
HBox hBoxCopyright = new HBox ();
hBoxCopyright.PackStart (label, false, false, 5);
this.PackStart (hBoxCopyright, false, true, 5);
this.ShowAll ();
}
示例5: ShowLogFileButton
private void ShowLogFileButton(){
HBox box = new HBox();
box.PackStart(logFileButImage, true, true, 0);
box.PackStart(logFileButLabel, true, true, 0);
setSensorLogNameButton.Add(box);
setSensorLogNameButton.ShowAll();
}
示例6: ParameterInformationWindow
public ParameterInformationWindow ()
{
heading = new Gtk.Label ("");
heading.Xalign = 0;
heading.Wrap = false;
desc = new DescriptionLabel ();
count = new Gtk.Label ("");
var mainBox = new HBox (false, 2);
HBox arrowHBox = new HBox ();
goPrev = new Gtk.Arrow (Gtk.ArrowType.Up, ShadowType.None);
arrowHBox.PackStart (goPrev, false, false, 0);
arrowHBox.PackStart (count, false, false, 0);
goNext = new Gtk.Arrow (Gtk.ArrowType.Down, ShadowType.None);
arrowHBox.PackStart (goNext, false, false, 0);
VBox vBox = new VBox ();
vBox.PackStart (arrowHBox, false, false, 0);
mainBox.PackStart (vBox, false, false, 0);
mainBox.PackStart (heading, true, true, 0);
var vBox2 = new VBox ();
vBox2.BorderWidth = 3;
vBox2.PackStart (mainBox, false, false, 0);
vBox2.PackStart (desc, true, true, 4);
Add (vBox2);
EnableTransparencyControl = true;
ShowAll ();
}
示例7: DemoMain
public DemoMain ()
{
SetupDefaultIcon ();
window = new Gtk.Window ("Gtk# Code Demos");
window.SetDefaultSize (600, 400);
window.DeleteEvent += new DeleteEventHandler (WindowDelete);
HBox hbox = new HBox (false, 0);
window.Add (hbox);
treeView = CreateTree ();
hbox.PackStart (treeView, false, false, 0);
Notebook notebook = new Notebook ();
hbox.PackStart (notebook, true, true, 0);
notebook.AppendPage (CreateText (infoBuffer, false), new Label ("_Info"));
TextTag heading = new TextTag ("heading");
heading.Font = "Sans 18";
infoBuffer.TagTable.Add (heading);
notebook.AppendPage (CreateText (sourceBuffer, true), new Label ("_Source"));
window.ShowAll ();
}
示例8: SparkleWindow
public SparkleWindow()
: base("")
{
BorderWidth = 0;
IconName = "folder-sparkleshare";
Resizable = true;
WindowPosition = WindowPosition.Center;
SetDefaultSize (640, 480);
Buttons = CreateButtonBox ();
HBox = new HBox (false, 6);
string image_path = SparkleHelpers.CombineMore (Defines.DATAROOTDIR, "sparkleshare",
"pixmaps", "side-splash.png");
Image side_splash = new Image (image_path);
VBox = new VBox (false, 0);
Wrapper = new VBox (false, 0) {
BorderWidth = 30
};
VBox.PackStart (Wrapper, true, true, 0);
VBox.PackStart (Buttons, false, false, 0);
HBox.PackStart (side_splash, false, false, 0);
HBox.PackStart (VBox, true, true, 0);
base.Add (HBox);
}
示例9: GetButton
public static Widget GetButton (Action action, bool label)
{
Widget w = action.CreateIcon (IconSize.Button);
if (label) {
HBox box = new HBox ();
box.PackStart (w, false, false, 0);
Label l = new Label ();
l.Markup = "<small>" + action.Label + "</small>";
box.PackStart (l);
w = box;
}
Button button;
if (action is ToggleAction) {
ToggleButton toggle = new ToggleButton ();
toggle.Active = ((ToggleAction)action).Active;
button = toggle;
} else {
button = new Button ();
}
button.Relief = ReliefStyle.None;
button.Add (w);
w.ShowAll ();
action.ConnectProxy (button);
tips.SetTip (button, action.Tooltip, String.Empty);
return button;
}
示例10: BuildDialogUI
void BuildDialogUI()
{
// Add an HBox to the dialog's VBox.
HBox hbox = new HBox (false, 8);
hbox.BorderWidth = 8;
this.VBox.PackStart (hbox, false, false, 0);
// Add an Image widget to the HBox using a stock 'info' icon.
Image stock = new Image (Stock.DialogInfo, IconSize.Dialog);
hbox.PackStart (stock, false, false, 0);
// Here we are using a Table to contain the other widgets.
// Notice that the Table is added to the hBox.
Table table = new Table (2, 2, false);
table.RowSpacing = 4;
table.ColumnSpacing = 4;
hbox.PackStart (table, true, true, 0);
Label label = new Label ("_Username");
table.Attach (label, 0, 1, 0, 1);
table.Attach (usernameEntry, 1, 2, 0, 1);
label.MnemonicWidget = usernameEntry;
label = new Label ("_Password");
table.Attach (label, 0, 1, 1, 2);
table.Attach (passwordEntry , 1, 2, 1, 2);
label.MnemonicWidget = passwordEntry ;
hbox.ShowAll ();
// Add OK and Cancel Buttons.
this.AddButton(Stock.Ok, ResponseType.Ok);
this.AddButton(Stock.Cancel, ResponseType.Cancel);
}
示例11: Clear
public void Clear ()
{
if (contentBox != null)
contentBox.Destroy ();
noContentLabel = new Label ();
noContentLabel.Text = noContentMessage;
noContentLabel.Xalign = 0F;
noContentLabel.Justify = Justification.Left;
noContentLabel.SetPadding (6, 6);
addButton = new Button ();
addButton.Label = addMessage;
// addButton.Relief = ReliefStyle.None;
addButton.Clicked += delegate {
OnCreateNew (EventArgs.Empty);
};
contentBox = new VBox ();
contentBox.PackStart (this.noContentLabel, true, true, 6);
var hbox = new HBox ();
hbox.PackStart (addButton, false, false, 0);
contentBox.PackEnd (hbox, false, false, 0);
PackStart (contentBox, true, true, 6);
ShowAll ();
}
示例12: initGui
private void initGui()
{
//create the layout
VBox layout = new VBox();
//add the list
ScrolledWindow sw = new ScrolledWindow();
sw.AddWithViewport( list );
layout.PackStart ( sw );
//add the add/edit/remove buttons
HBox hbox = new HBox();
hbox.PackStart ( BtnAdd );
hbox.PackStart ( BtnEdit );
hbox.PackStart ( BtnRemove );
hbox.PackStart ( BtnSort );
layout.PackStart( hbox, false, true, 0 );
//add the checkboxes
hbox = new HBox();
hbox.PackStart( ChkOwnerDrawned , true, true, 0 );
hbox.PackStart( ChkIsCheckBoxList, true, true, 0 );
hbox.PackStart( ChkIsEditable , true, true, 0 );
hbox.PackStart( ChkDragAndDrop , true, true, 0 );
//
layout.PackStart( hbox, false, true, 0 );
//add layout
this.Add( layout );
}
示例13: OnButtonClicked
protected void OnButtonClicked(object sender, EventArgs e)
{
if (sender == button1)
{
Gtk.FileChooserDialog dialog = new Gtk.FileChooserDialog ("Choose item...", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Insert Spacer", ResponseType.None, "Add", ResponseType.Accept);
Gtk.Alignment align = new Alignment (1, 0, 0, 1);
Gtk.Frame frame = new Frame ("Position");
Gtk.HBox hbox = new HBox (false, 4);
RadioButton rbRight;
rbRight = new RadioButton ("Right");
hbox.PackEnd(rbRight, false, false, 1);
hbox.PackEnd(new RadioButton (rbRight, "Left"), false, false, 1);
frame.Add (hbox);
align.Add (frame);
align.ShowAll ();
dialog.ExtraWidget = align;
ResponseType response = (ResponseType)dialog.Run ();
if (response == ResponseType.Accept) {
RunCommand ("defaults write com.apple.dock " + GetAlign(dialog.ExtraWidget) + " -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>" + dialog.Filename + "</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' && /bin/sleep 1 &&/usr/bin/killall Dock");
} else if (response == ResponseType.None) {
RunCommand ("defaults write com.apple.dock " + GetAlign(dialog.ExtraWidget) + " -array-add '{tile-data={}; tile-type=\"spacer-tile\";}' && /bin/sleep 1 &&/usr/bin/killall Dock");
}
dialog.Destroy ();
}
}
示例14: AddNewWordToDic
public static void AddNewWordToDic(object sender, EventArgs e)
{
var win = new Gtk.Window("Přidej slovo");
win.SetPosition( WindowPosition.Mouse );
Label l = new Label();
l.Text = "Vloží slovo do aktuálně načteného slovníku, avšak nezmění zdroj (např. soubor dic.txt )";
Entry entry = new Entry();
Button b = new Button("Přidej");
VBox vbox = new VBox();
HBox hbox = new HBox();
vbox.BorderWidth = 10;
vbox.PackStart( l );
vbox.PackEnd( hbox );
hbox.PackStart( entry );
hbox.PackEnd( b );
b.Clicked += delegate {
game.dictionary.Add( entry.Text );
win.HideAll();
win.Destroy();
win.Dispose();
};
win.Add(vbox);
win.ShowAll();
}
示例15: Main
static void Main ()
{
Application.Init ();
Gtk.Window w = new Gtk.Window ("System.Drawing and Gtk#");
// Custom widget sample
a = new PrettyGraphic ();
// Event-based drawing
b = new DrawingArea ();
b.ExposeEvent += new ExposeEventHandler (ExposeHandler);
b.SizeAllocated += new SizeAllocatedHandler (SizeAllocatedHandler);
Button c = new Button ("Quit");
c.Clicked += new EventHandler (quit);
MovingText m = new MovingText ();
Box box = new HBox (true, 0);
box.Add (a);
box.Add (b);
box.Add (m);
box.Add (c);
w.Add (box);
w.ShowAll ();
Application.Run ();
}