📄 migrate_to_4x.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"> <title>Migrate_to_ver4</title></head><body><table cellpadding="2" cellspacing="2" border="0" style="width: 660px; text-align: left; margin-left: auto; margin-right: auto;"> <tbody> <tr> <td style="vertical-align: top;"> <h2 style="color: rgb(51, 51, 255);">Migrate to OpenGUI 4.0.4and obove from older versions</h2> <p><strong>(18.march 2003)</strong></p> <p>NOTE: If you don't need QNX 4.x compatibility, stay with version 3.x.of OpenGUI.</p> <p><br>There are big changes because of rewriting some parts of the library toget better performance clean design and the reentrant code.<br> <br> <span style="font-weight: bold;">Changes for 4.x in short:</span><br> </p> <ul> <li><font face="Arial">the NASM assembler utility is no morerequired for compiling on any platform</font></li> <font face="Arial"> <li><font face="Arial">reentrant code forall windowed code</font></li> <li><font face="Arial">thread-safe locking on critical sections</font></li> <li><font face="Arial">each drawable object contains PAPER,INK, FONT and PPOP and only these are used for drawing on them. <font face="Arial" style="font-weight: bold;">DrawBuffer::</font><span style="font-weight: bold;">set_fcolor()</span>, </font></li> </font><font face="Arial" style="font-weight: bold;">DrawBuffer::</font><font face="Arial"><span style="font-weight: bold;">set_bcolor()</span>, </font><font face="Arial" style="font-weight: bold;">DrawBuffer::</font><font face="Arial"><span style="font-weight: bold;">set_ppop()</span> & </font><font face="Arial" style="font-weight: bold;">DrawBuffer::</font><font face="Arial"><font face="Arial"><span style="font-weight: bold;">set_font()</span>asthe DrawBuffer methods</font> <li value="5"><font face="Arial">globalversion of <span style="font-weight: bold;">set_fcolor()</span>, <span style="font-weight: bold;">set_bcolor()</span>, <span style="font-weight: bold;">set_ppop()</span> & <span style="font-weight: bold;">set_font()</span>, will be removed - affectonly non object code (<span style="font-weight: bold;">draw_line()</span>, <span style="font-weight: bold;">fill_box()</span> etc)</font></li> <li><font face="Arial">no -fPIC compile flags are necessaryunder LINUX & shared linking</font></li> <li><font face="Arial">the API has been cleaned and changes areminor (and well documented)</font></li> <li><font face="Arial">the classes FileDialog() and ColorDialogmay be instatiated more than once at the same time</font></li> <li><font face="Arial">on now there are no Watcom C++ or QNX OSsupport (because of banking video modes)</font></li> <li><font face="Arial">only C++ language is supported</font></li> <li><font face="Arial">the active EditBoxes are per window now</font></li> <li>most of static variables are removed.</li> </font> <li><font face="Arial"></font>this version is still notvery well optimized for speed </li> <li><font face="Arial">added macros for differentiate versionsFG_MINOR, FG_MAJOR, FG_PATCH</font></li> <li><font face="Arial">you can remove file OpenGUI.def fromyour WIN32 projects</font></li> </ul> <p><font face="Arial">Convenience:<br> </font></p> <ul> <li style="color: rgb(255, 0, 0);">the old code or code toremove with new port is marked red</li> <li><span style="color: rgb(51, 51, 255);">the new code ismarked blue</span><br> </li> </ul> <p><code><font face="Arial"><span style="font-weight: bold;">1.redundant set_ppop() with global scope - this funcion is no moreneeded.</span><br> <br> <span style="font-style: italic;"> static voidInstalaterProc(GuiEvent *p)</span><br style="font-style: italic;"> <span style="font-style: italic;"> {</span><br style="font-style: italic;"> <span style="font-style: italic;"> switch(p->GetType()) {</span><br style="font-style: italic;"> <span style="font-style: italic;"> case INITEVENT:</span><br style="font-style: italic;"> <span style="font-style: italic;"> </span><span style="color: rgb(255, 0, 0); font-style: italic;">set_ppop(_GSET);</span><br style="font-style: italic;"> <span style="font-style: italic;"> p->wnd->AddPushButton(464, 168+36, 128, 23, "Koniec", 'k',Control::Quit);</span><br style="font-style: italic;"> <span style="font-style: italic;"> break;</span><br style="font-style: italic;"> <span style="font-style: italic;"> case TERMINATEEVENT:</span><br style="font-style: italic;"> <span style="font-style: italic;"> break;</span><br style="font-style: italic;"> <span style="font-style: italic;"> }</span><br style="font-style: italic;"> <span style="font-style: italic;"> }</span><br style="font-style: italic;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">2. replacement & newprototypes</span><br> <br> <span style="font-style: italic; color: rgb(255, 0, 0);"> outp() -><strong> <font color="#0000ff">outpb();</font></strong></span><br style="font-style: italic; color: rgb(255, 0, 0);"> <span style="font-style: italic; color: rgb(255, 0, 0);"> inp() -><strong> <font color="#0000ff">inpb();</font></strong></span><br style="font-style: italic; color: rgb(255, 0, 0);"> <span style="font-style: italic; color: rgb(255, 0, 0);"> X_width -><strong> <font color="#0000ff">GetXRes();</font></strong></span><br style="font-style: italic; color: rgb(255, 0, 0);"> <span style="font-style: italic; color: rgb(255, 0, 0);"> Y_width -><strong> <font color="#0000ff">GetYRes();</font></strong></span><br style="font-style: italic; color: rgb(255, 0, 0);"> <span style="font-style: italic; color: rgb(255, 0, 0);"> X_max -><strong> <font color="#0000ff">(GetXRes()-1);</font></strong></span><br style="font-style: italic; color: rgb(255, 0, 0);"> <span style="font-style: italic; color: rgb(255, 0, 0);"> Y_max -><strong> <font color="#0000ff">(GetYRes()-1);</font></strong></span><br style="font-style: italic; color: rgb(255, 0, 0);"> <span style="font-style: italic; color: rgb(255, 0, 0);"> videobase -><strong> <font color="#0000ff">GetFrameBuffer();</font></strong></span><br style="font-style: italic; color: rgb(255, 0, 0);"> <span style="font-style: italic; color: rgb(255, 0, 0);"> class ListBox -><strong> <font color="#0000ff">class FGListBox;</font></strong></span><br style="font-style: italic; color: rgb(255, 0, 0);"> <span style="font-style: italic; color: rgb(255, 0, 0);"> template FGList<> -><strong> <font color="#0000ff">templatestd::list<> ( or std::vector<> )</font></strong></span><br style="font-style: italic; color: rgb(255, 0, 0);"> <br style="font-style: italic;"> <span style="font-style: italic;"><span style="color: rgb(51, 51, 255); font-weight: bold;"> fill_convex(vrcholov, pp, CGRAYED, _GSET);</span><br> </span><br> <span style="font-style: italic; color: rgb(255, 0, 0);"> set_fcolor(CGRAYED);</span><br style="font-style: italic; color: rgb(255, 0, 0);"> <span style="font-style: italic; color: rgb(255, 0, 0);"> set_ppop(_GSET);</span><br style="font-style: italic; color: rgb(255, 0, 0);"> <span style="font-style: italic; color: rgb(255, 0, 0);"> fill_convex(vrcholov, pp);</span><br style="font-style: italic; color: rgb(255, 0, 0);"> <br style="font-style: italic;"> <span style="font-style: italic;"><span style="color: rgb(51, 51, 255); font-weight: bold;"> fill_convex(vrcholov, pp, CGRAYED, _GSET);</span><br> </span><br> <br> <span style="font-style: italic;"> <span style="color: rgb(255, 0, 0);">set_fcolor(CGRAYED);</span></span><br style="font-style: italic; color: rgb(255, 0, 0);"> <span style="font-style: italic; color: rgb(255, 0, 0);"> set_ppop(_GXOR);</span><br style="font-style: italic; color: rgb(255, 0, 0);"> <span style="font-style: italic; color: rgb(255, 0, 0);"> draw_convex(vrcholov, pp);</span><br style="font-style: italic;"> <br style="font-style: italic;"> <span style="font-style: italic; font-weight: bold; color: rgb(51, 51, 255);"> draw_convex(vrcholov, pp, CGRAYED, _GXOR);</span><br style="font-style: italic;">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -