本文整理汇总了C#中Gtk.HBox类的典型用法代码示例。如果您正苦于以下问题:C# HBox类的具体用法?C# HBox怎么用?C# HBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HBox类属于Gtk命名空间,在下文中一共展示了HBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:34,代码来源:InsightWindow.cs
示例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 ();
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:31,代码来源:DockToolbarFrame.cs
示例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 ();
}
开发者ID:directhex,项目名称:xamarin-gnome-sharp2,代码行数:30,代码来源:CanvasExample.cs
示例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 ();
}
开发者ID:tackle-cat,项目名称:Pinta,代码行数:28,代码来源:AboutPintaTabPage.cs
示例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();
}
开发者ID:seipekm,项目名称:MonoBrick-Communication-Software,代码行数:7,代码来源:SensorPage.cs
示例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 ();
}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:33,代码来源:ParameterInformationWindow.cs
示例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 ();
}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:25,代码来源:DemoMain.cs
示例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);
}
开发者ID:kristi,项目名称:SparkleShare,代码行数:33,代码来源:SparkleWindow.cs
示例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;
}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:27,代码来源:ItemAction.cs
示例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);
}
开发者ID:sergi,项目名称:Wakame,代码行数:33,代码来源:LoginDialog.cs
示例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 ();
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:27,代码来源:ExpanderList.cs
示例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 );
}
开发者ID:tizianomanni,项目名称:holly-gtk-widgets,代码行数:27,代码来源:SimpleList.cs
示例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 ();
}
}
开发者ID:Eun,项目名称:AddAnyDock,代码行数:31,代码来源:MainWindow.cs
示例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();
}
开发者ID:Kedrigern,项目名称:scrabble,代码行数:29,代码来源:staticWindows.cs
示例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 ();
}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:28,代码来源:DrawingSample.cs
示例16: TopBar
// create the TopBar widget
public TopBar()
{
// create the widgets
Button add_button = new Button (Stock.Add);
Button remove_button = new Button (Stock.Remove);
Label search_label = new Label ("Search:");
Image clear_image = new Image (Stock.Clear, IconSize.Menu);
clear_box.Add (clear_image);
// hook up the widget events
add_button.Clicked += add_clicked;
remove_button.Clicked += remove_clicked;
search.Changed += search_changed;
clear_box.ButtonReleaseEvent += clear_released;
clear_box.Realized += clear_realized;
// homogeneous button box
HBox button_box = new HBox (true, 0);
button_box.PackStart (add_button, false, true, 0);
button_box.PackStart (remove_button, false, true, 0);
// pack widgets
this.PackStart (button_box, false, true, 0);
this.PackStart (search_label, false, false, 5);
this.PackStart (search, true, true, 0);
this.PackStart (clear_box, false, false, 0);
}
开发者ID:gsterjov,项目名称:fusemc,代码行数:29,代码来源:TopBar.cs
示例17: AddMessage
public void AddMessage (string msg, IconId icon)
{
if (lastImage != null) {
HSeparator sep = new HSeparator ();
sep.Show ();
msgBox.PackStart (sep, false, false, 0);
lastImage.IconSize = Gtk.IconSize.Menu;
}
HBox box = new HBox ();
box.Spacing = 12;
Alignment imgBox = new Alignment (0, 0, 0, 0);
var img = new ImageView (icon, lastImage != null ? Gtk.IconSize.Menu : IconSize.Dialog);
imgBox.Add (img);
lastImage = img;
box.PackStart (imgBox, false, false, 0);
Label lab = new Label (msg);
lab.UseUnderline = false;
lab.Xalign = 0;
lab.Yalign = 0;
lab.Wrap = true;
lab.WidthRequest = 500;
box.PackStart (lab, true, true, 0);
msgBox.PackStart (box, false, false, 0);
box.ShowAll ();
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:26,代码来源:MultiMessageDialog.cs
示例18: DockFrame
public DockFrame ()
{
shadedContainer = new ShadedContainer ();
dockBarTop = new DockBar (this, Gtk.PositionType.Top);
dockBarBottom = new DockBar (this, Gtk.PositionType.Bottom);
dockBarLeft = new DockBar (this, Gtk.PositionType.Left);
dockBarRight = new DockBar (this, Gtk.PositionType.Right);
container = new DockContainer (this);
HBox hbox = new HBox ();
hbox.PackStart (dockBarLeft, false, false, 0);
hbox.PackStart (container, true, true, 0);
hbox.PackStart (dockBarRight, false, false, 0);
mainBox = new VBox ();
mainBox.PackStart (dockBarTop, false, false, 0);
mainBox.PackStart (hbox, true, true, 0);
mainBox.PackStart (dockBarBottom, false, false, 0);
Add (mainBox);
mainBox.ShowAll ();
mainBox.NoShowAll = true;
CompactGuiLevel = 2;
dockBarTop.UpdateVisibility ();
dockBarBottom.UpdateVisibility ();
dockBarLeft.UpdateVisibility ();
dockBarRight.UpdateVisibility ();
}
开发者ID:nieve,项目名称:monodevelop,代码行数:27,代码来源:DockFrame.cs
示例19: ParameterInformationWindow
public ParameterInformationWindow()
{
desc = new Gtk.Label ("");
desc.Xalign = 0;
desc.Wrap = true;
count = new Gtk.Label ("");
mainBox = new HBox (false, 2);
mainBox.BorderWidth = 3;
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 (desc, true, true, 0);
mainBox.ShowAll ();
this.Add (mainBox);
EnableTransparencyControl = true;
}
开发者ID:moscrif,项目名称:ide,代码行数:28,代码来源:ParameterInformationWindow.cs
示例20: BDialog
public BDialog(string aName, Gtk.Window aParent, string aText)
: base(aName, aParent, Gtk.DialogFlags.NoSeparator)
{
// setup dialog
this.Modal = true;
this.BorderWidth = 6;
this.HasSeparator = false;
this.Resizable = false;
this.VBox.Spacing=12;
// graphic items
hbox = new Gtk.HBox();
Gtk.VBox labelBox = new VBox();
label = new Gtk.Label();
image = new Gtk.Image();
hbox.Spacing=12;
hbox.BorderWidth=6;
this.VBox.Add(hbox);
// set-up image
image.Yalign=0.0F;
hbox.Add(image);
// set-up label
label.Yalign=0.0F;
label.Xalign=0.0F;
label.UseMarkup=true;
label.Wrap=true;
label.Markup=aText;
// add to dialog
labelBox.Add(label);
hbox.Add(labelBox);
}
开发者ID:BackupTheBerlios,项目名称:beline-svn,代码行数:35,代码来源:Dialogs.cs
注:本文中的Gtk.HBox类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论