当前位置: 首页>>代码示例>>C#>>正文


C# ScrolledWindow.SetUsize方法代码示例

本文整理汇总了C#中Gtk.ScrolledWindow.SetUsize方法的典型用法代码示例。如果您正苦于以下问题:C# ScrolledWindow.SetUsize方法的具体用法?C# ScrolledWindow.SetUsize怎么用?C# ScrolledWindow.SetUsize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.ScrolledWindow的用法示例。


在下文中一共展示了ScrolledWindow.SetUsize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EditWindow

        public EditWindow(Invoice invoice,
		                  string file,
		                  InvoiceDirectory idir_,
                          InvoicesChanged cb)
            : base(WindowType.Toplevel)
        {
            loadedFile = file;
            idir = idir_;
            callback = cb;

            VBox box = new VBox(false, 0);
            table = new Table(7, 3, false);
            Table tablespec = new Table(16, 4, false);
            tablesum = new Table(4, 2, false);

            HButtonBox buttons = new HButtonBox();
            Button save = Button.NewWithLabel("Spara");
            Button abort = Button.NewWithLabel("Avbryt");

            namn = new Entry();
            address = new Entry();
            postnr = new Entry();
            postort = new Entry();
            referens = new Entry();
            datum = new Entry();
            fakturanr = new Entry();
            antaldgr = new Entry();

            ScrolledWindow scrolled = new ScrolledWindow();
            Button GetAddress = Button.NewWithLabel("Slå upp address");

            Add(box);
            scrolled.AddWithViewport(tablespec);
            scrolled.SetPolicy(PolicyType.Never, PolicyType.Automatic);
            box.PackStart(table, false, false, 0);
            box.PackStart(scrolled, true, true, 0);
            scrolled.SetUsize(~1, 250);

            box.PackStart(tablesum, false, false, 0);
            box.PackStart(buttons,  false, false, 0);

            buttons.PackStart(save);
            buttons.PackStart(abort);

            specs = new Spec[15];
            for (uint i=0; i<15; i++) {
                specs[i] = new Spec(invoice.specs[i], tablespec, i + 1);
                specs[i].Changed += RecalcSum;
            }

            tablespec.Attach(new Label("Beskrivning"), 0, 1, 0, 1, 0, 0, 0, 0);
            tablespec.Attach(new Label("Antal"),       1, 2, 0, 1, 0, 0, 0, 0);
            tablespec.Attach(new Label("À pris"),      2, 3, 0, 1, 0, 0, 0, 0);
            tablespec.Attach(new Label("Belopp"),      3, 4, 0, 1, 0, 0, 0, 0);

            SetPosition(WindowPosition.Center);

            namn.Changed += UpdateTitle;
            fakturanr.Changed += UpdateTitle;

            namn.Text = invoice.namn;
            address.Text = invoice.address;
            postnr.Text = invoice.postnr;
            postort.Text = invoice.postort;
            referens.Text = invoice.referens;
            datum.Text = invoice.datum;
            fakturanr.Text = invoice.fakturanr;
            antaldgr.Text = invoice.antaldgr;

            labround = new Label("0");
            labsum   = new Label("0");
            labmoms  = new Label("0");
            labtot   = new Label("0");

            RecalcSum();

            Attach2(0, "Namn", namn);
            table.Attach(GetAddress, 2, 3, 0, 1, 0, 0, 0, 0);
            Attach2(1, "Address", address);
            Attach2(2, "Postnummer", postnr);
            Attach2(3, "Postort", postort);
            Attach2(4, "Er referens", referens);
            Attach2(5, "Datum", datum);
            Attach2(6, "Fakturanummer", fakturanr);
            Attach2(7, "Antal dagar",   antaldgr);

            Attach3(0, "Avrundning", labround);
            Attach3(1, "Summa", labsum);
            Attach3(2, "Moms", labmoms);
            Attach3(3, "Att betala", labtot);

            abort.Clicked += Abort;
            save.Clicked += Save;
            GetAddress.Clicked += FindAddress;

            box.ShowAll();
        }
开发者ID:nhoglund,项目名称:Faktureringsprogrammet,代码行数:97,代码来源:EditWindow.cs


注:本文中的Gtk.ScrolledWindow.SetUsize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。