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


C# Viewport.SetSizeRequest方法代码示例

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


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

示例1: addMainPanel

    /**
     * Method will be responsible for creating all main visual information used in this tool.
     * Achieved with numerous helper methods.
     * **/
    private void addMainPanel()
    {
        //holds graph + mem row size info
        graphContainer = new VBox ();

        EventBox rowSizeLabelContainer = new EventBox ();

        Label rowSizeLabel = new Label ("Row size: " + FileParser.FileParser.MemRowSize);
        rowSizeLabel.Style = subHeaderLabelStyle.Copy ();

        rowSizeLabel.SetSizeRequest(Constants.Constants.GRAPH_SIDE, 50);
        rowSizeLabelContainer.Add (rowSizeLabel);
        graphContainer.PackStart (rowSizeLabelContainer, false, false, 10);
        populateGraph ();

        //create grid layout that will hold block information and visual representation of memory
        HBox graphHBox = new HBox ();
        graphHBox.PackStart (graph, true, true, 40);

        graphContainer.PackStart (graphHBox, false, false, 50);

        //give border to legend container
        graphFrame = new Frame ();
        graphFrame.SetSizeRequest (Constants.Constants.GRAPH_CONTAINER_SIDE, Constants.Constants.LINK_PANEL_HEIGHT + 100);

        Viewport graphViewPort = new Viewport ();

        graphViewPort.SetSizeRequest (Constants.Constants.GRAPH_CONTAINER_SIDE, Constants.Constants.LINK_PANEL_HEIGHT);
        graphViewPort.Add (graphContainer);

        //add the window for the graph frame
        graphWindow = new ScrolledWindow ();
        graphWindow.SetSizeRequest (Constants.Constants.GRAPH_SIDE, Constants.Constants.LINK_PANEL_HEIGHT);
        graphWindow.Add (graphViewPort);

        graphFrame.Add (graphWindow);
    }
开发者ID:gnikonorov,项目名称:MemoryVisualizer,代码行数:41,代码来源:MainWindow.cs

示例2: addLinkPanel

    /**
     * Creates the "link" panel, which shows links between free blocks
     * */
    private void addLinkPanel()
    {
        //master mid panel container
        midPanel = new VBox ();

        //will store links between free blocks
        linkPanel = new VBox ();
        linkPanel.SetSizeRequest(Constants.Constants.LINK_PANEL_WIDTH, Constants.Constants.LINK_PANEL_HEIGHT);

        Label linkHeader = new Label (Constants.Constants.LinkHeader);
        linkHeader.Style = subHeaderLabelStyle.Copy ();

        linkPanel.PackStart (linkHeader, false, false, 10);

        //get the address link and insert values in form list[i] -> list[i + 1]
        List<int> addresses = FileParser.FileParser.AddressList;

        String link = "";
        for (int i = 0; i < addresses.Count; i++)
        {
            //make the link string
            link += "0x";
            link += addresses [i].ToString ("X");
            link += " -> ";

            if (i < addresses.Count - 1)
                link += ("0x" + addresses [i + 1].ToString ("X"));
            else
                link += "NULL";

            //insert it into thepanel
            Label linkInfoLabel = new Label (link);
            linkInfoLabel.Style = linkInfoStyle.Copy ();
            linkPanel.PackStart (linkInfoLabel, false, false, 5);

            //reset link
            link = "";
        }

        Viewport linkViewPort = new Viewport ();
        linkViewPort.SetSizeRequest(Constants.Constants.LINK_PANEL_WIDTH, Constants.Constants.LINK_PANEL_HEIGHT);
        linkViewPort.Add (linkPanel);

        //add the window for the graph frame
        linkWindow = new ScrolledWindow ();
        linkViewPort.SetSizeRequest(Constants.Constants.LINK_PANEL_WIDTH, Constants.Constants.LINK_PANEL_HEIGHT);
        linkWindow.Add (linkViewPort);

        //give border to legend container
        Frame f = new Frame ();
        f.Add (linkWindow);

        midPanel.PackStart (f, false, false, 10);
    }
开发者ID:gnikonorov,项目名称:MemoryVisualizer,代码行数:57,代码来源:MainWindow.cs


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