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


C++ TextArea::setFont方法代码示例

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


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

示例1: setBackground

PanelCrashReport(UnexpectedThrowable PanelCrashReport::unexpectedthrowable) 
{
        setBackground(new Color(0x2e3444));
        setLayout(new BorderLayout());
        StringWriter stringwriter = new StringWriter();
        unexpectedthrowable.field_6514_b.printStackTrace(new PrintWriter(stringwriter));
        String s = stringwriter.toString();
        String s1 = "";
        String s2 = "";
        try
        {
            s2 = (new StringBuilder()).append(s2).append("Generated ").append((new SimpleDateFormat()).format(new Date())).append("\n").toString();
            s2 = (new StringBuilder()).append(s2).append("\n").toString();
            s2 = (new StringBuilder()).append(s2).append("Minecraft: Minecraft Alpha v1.2.2 (Mrneo240 Custom v0.4)\n").toString();
            s2 = (new StringBuilder()).append(s2).append("OS: ").append(System.getProperty("os.name")).append(" (").append(System.getProperty("os.arch")).append(") version ").append(System.getProperty("os.version")).append("\n").toString();
            s2 = (new StringBuilder()).append(s2).append("Java: ").append(System.getProperty("java.version")).append(", ").append(System.getProperty("java.vendor")).append("\n").toString();
            s2 = (new StringBuilder()).append(s2).append("VM: ").append(System.getProperty("java.vm.name")).append(" (").append(System.getProperty("java.vm.info")).append("), ").append(System.getProperty("java.vm.vendor")).append("\n").toString();
            s2 = (new StringBuilder()).append(s2).append("LWJGL: ").append(Sys.getVersion()).append("\n").toString();
            s1 = GL11.glGetString(7936);
            s2 = (new StringBuilder()).append(s2).append("OpenGL: ").append(GL11.glGetString(7937)).append(" version ").append(GL11.glGetString(7938)).append(", ").append(GL11.glGetString(7936)).append("\n").toString();
        }
        catch(Throwable throwable)
        {
            s2 = (new StringBuilder()).append(s2).append("[failed to get system properties (").append(throwable).append(")]\n").toString();
        }
        s2 = (new StringBuilder()).append(s2).append("\n").toString();
        s2 = (new StringBuilder()).append(s2).append(s).toString();
        String s3 = "";
        s3 = (new StringBuilder()).append(s3).append("\n").toString();
        s3 = (new StringBuilder()).append(s3).append("\n").toString();
        if(s.contains("Pixel format not accelerated"))
        {
            s3 = (new StringBuilder()).append(s3).append("      Bad video card drivers!      \n").toString();
            s3 = (new StringBuilder()).append(s3).append("      -----------------------      \n").toString();
            s3 = (new StringBuilder()).append(s3).append("\n").toString();
            s3 = (new StringBuilder()).append(s3).append("Minecraft was unable to start because it failed to find an accelerated OpenGL mode.\n").toString();
            s3 = (new StringBuilder()).append(s3).append("This can usually be fixed by updating the video card drivers.\n").toString();
            if(s1.toLowerCase().contains("nvidia"))
            {
                s3 = (new StringBuilder()).append(s3).append("\n").toString();
                s3 = (new StringBuilder()).append(s3).append("You might be able to find drivers for your video card here:\n").toString();
                s3 = (new StringBuilder()).append(s3).append("  http://www.nvidia.com/\n").toString();
            } else
            if(s1.toLowerCase().contains("ati"))
            {
                s3 = (new StringBuilder()).append(s3).append("\n").toString();
                s3 = (new StringBuilder()).append(s3).append("You might be able to find drivers for your video card here:\n").toString();
                s3 = (new StringBuilder()).append(s3).append("  http://www.amd.com/\n").toString();
            }
        } else
        {
            s3 = (new StringBuilder()).append(s3).append("      Minecraft has crashed!      \n").toString();
            s3 = (new StringBuilder()).append(s3).append("      ----------------------      \n").toString();
            s3 = (new StringBuilder()).append(s3).append("\n").toString();
            s3 = (new StringBuilder()).append(s3).append("Minecraft has stopped running because it encountered a problem.\n").toString();
            s3 = (new StringBuilder()).append(s3).append("\n").toString();
            s3 = (new StringBuilder()).append(s3).append("If you wish to report this, please copy this entire text and email it to [email protected]\n").toString();
            s3 = (new StringBuilder()).append(s3).append("Please include a description of what you did when the error occured.\n").toString();
        }
        s3 = (new StringBuilder()).append(s3).append("\n").toString();
        s3 = (new StringBuilder()).append(s3).append("\n").toString();
        s3 = (new StringBuilder()).append(s3).append("\n").toString();
        s3 = (new StringBuilder()).append(s3).append("--- BEGIN ERROR REPORT ").append(Integer.toHexString(s3.hashCode())).append(" --------\n").toString();
        s3 = (new StringBuilder()).append(s3).append(s2).toString();
        s3 = (new StringBuilder()).append(s3).append("--- END ERROR REPORT ").append(Integer.toHexString(s3.hashCode())).append(" ----------\n").toString();
        s3 = (new StringBuilder()).append(s3).append("\n").toString();
        s3 = (new StringBuilder()).append(s3).append("\n").toString();
        TextArea textarea = new TextArea(s3, 0, 0, 1);
        textarea.setFont(new Font("Monospaced", 0, 12));
        add(new CanvasMajongLogo(), "North");
        add(new CanvasCrashReport(80), "East");
        add(new CanvasCrashReport(80), "West");
        add(new CanvasCrashReport(100), "South");
        add(textarea, "Center");
}
开发者ID:mrneo240,项目名称:MineC--,代码行数:75,代码来源:PanelCrashReport.cpp


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