{"id":1633,"date":"2008-03-07T15:27:38","date_gmt":"2008-03-07T15:27:38","guid":{"rendered":"http:\/\/www.amibroker.org\/userkb\/2008\/03\/07\/a-basic-message-panel\/"},"modified":"2011-01-11T22:27:28","modified_gmt":"2011-01-11T22:27:28","slug":"a-basic-message-panel","status":"publish","type":"post","link":"http:\/\/www.amibroker.org\/editable_userkb\/2008\/03\/07\/a-basic-message-panel\/","title":{"rendered":"A Basic Messaging Panel"},"content":{"rendered":"

Also see Moving Low Level Graphics (GFX) Objects on your Charts<\/a><\/p>\n

This first post introduces you to the basic techniques on how to create a matrix of text cells to display messages and system status on your chart. At this stage the cells are not mouse-click sensitive; this and other features will be added later. In this example the number of columns, rows, the font size, and the location of the message panel, can be set from the Param window. In your final application you might want to make these parameters constant and remove the corresponding Param statements. You can combine any number of Panels, here is an example for multiple panels layouts:<\/p>\n

\"image\"<\/a><\/p>\n

The following simple panel is produced by the code in this post.<\/p>\n

\"image\"<\/a><\/p>\n

The code below will place the above Message panel on your chart. A code description follows below listing.<\/p>\n

\r<\/span>#include &lt;MessagePanelInclude.afl&gt;\r\r<\/span>global <\/span>ColNumber<\/span>;\r\r<\/span>CellHeight <\/span>= <\/span>Param<\/span>(<\/span>"Cell Height"<\/span>,<\/span>20<\/span>,<\/span>5<\/span>,<\/span>200<\/span>,<\/span>5<\/span>);\r\r<\/span>CellWidth <\/span>= <\/span>Param<\/span>(<\/span>"Cell Width"<\/span>,<\/span>120<\/span>,<\/span>5<\/span>,<\/span>200<\/span>,<\/span>5<\/span>);\r\r<\/span>PanelYoffset <\/span>= <\/span>Param<\/span>(<\/span>"Cell Row Offset (px)"<\/span>,<\/span>10<\/span>,<\/span>0<\/span>,<\/span>Status<\/span>(<\/span>"pxheight"<\/span>),<\/span>5<\/span>);\r\r<\/span>PanelXoffset <\/span>= <\/span>Param<\/span>(<\/span>"Cell Column Offset (px)"<\/span>,<\/span>10<\/span>,<\/span>0<\/span>,<\/span>Status<\/span>(<\/span>"pxwidth"<\/span>),<\/span>5<\/span>);\r\r<\/span>FontRatio <\/span>= <\/span>Param<\/span>(<\/span>"Font:CellHeight ratio"<\/span>,<\/span>2<\/span>,<\/span>1<\/span>,<\/span>20<\/span>,<\/span>0.1<\/span>);\r\r<\/span>MsgCol_Begin<\/span>( <\/span>"COLUMNNAME 1"<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 1"<\/span>, <\/span>BackgroundColor<\/span>=<\/span>1<\/span>, <\/span>TextColor<\/span>=<\/span>2<\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 2"<\/span>, <\/span>2<\/span>, <\/span>3<\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 3"<\/span>, <\/span>8<\/span>, <\/span>4<\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 4"<\/span>, <\/span>7<\/span>, <\/span>5<\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 5"<\/span>, <\/span>4<\/span>, <\/span>6<\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 6"<\/span>, <\/span>3<\/span>, <\/span>7<\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 7"<\/span>, <\/span>2<\/span>, <\/span>8<\/span>);\r\r<\/span>MsgCol_End<\/span>();\r\r<\/span>MsgCol_Begin<\/span>( <\/span>" COLUMNNAME 2"<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 1"<\/span>, <\/span>9<\/span>, <\/span>2<\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 2"<\/span>, <\/span>8<\/span>, <\/span>3<\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 3"<\/span>, <\/span>7<\/span>, <\/span>4<\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 4"<\/span>, <\/span>6<\/span>, <\/span>5<\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 5"<\/span>, <\/span>5<\/span>, <\/span>6<\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 6"<\/span>, <\/span>4<\/span>, <\/span>7<\/span>);\r\r<\/span>TextCell<\/span>( <\/span>"Text Message 7"<\/span>, <\/span>3<\/span>, <\/span>8<\/span>);\r\r<\/span>MsgCol_End<\/span>();\r<\/span><\/pre>\n

Message Panel code above calls the Include file listed at the end of this post. The The MsgCol_Begin() function defines the name and dimensions for the current column:<\/p>\n

MsgCol_Begin<\/span>( <\/span>"COLUMNNAME 1"<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>);<\/span><\/pre>\n

You can create many columns. The ColName is used in Static variables to allow the code to know to which Column the TextCells belong. The last four arguments are self-explanatory. The Overlay and background modes can be changed inside this function, or you can extract these GFX statements and execute them separately.<\/p>\n

The TextCell() function adds one TextCell to the column. It defines the Message, Background color, and TextColor to be used:<\/p>\n

\rTextCell<\/span>( <\/span>"Text Message 1"<\/span>, <\/span>colorBlack<\/span>, <\/span>colorWhite<\/span>);<\/span><\/pre>\n

The MsgCol_End() terminates the current column and draws the GFX pgraphics to the chart.<\/p>\n

The Include file makes extensive use of static variables that are wrapped in kStaticVar\u2026() to make the static variables unique to the current ChartID. This is needed to call the functions from different panes and windows without interfering with one another. For more on this see Keying Static Variables<\/a>.<\/p>\n

\r<\/span>\/\/ This is the Include file MessagePanelInclude.afl, copy to your default Include folder\r\r<\/span>procedure kStaticVarSet<\/span>( <\/span>SName<\/span>, <\/span>SValue <\/span>)\r\r{\r\r<\/span>ChartID <\/span>= <\/span>GetChartID<\/span>();\r\r<\/span>InIndicator <\/span>= <\/span>Status<\/span>(<\/span>"Action"<\/span>) == <\/span>1<\/span>;\r\rif( <\/span>InIndicator <\/span>) <\/span>StaticVarSet<\/span>(<\/span>Sname<\/span>+<\/span>ChartID<\/span>, <\/span>Svalue<\/span>);\r\r}\r\rfunction <\/span>kStaticVarGet<\/span>( <\/span>SName <\/span>)\r\r{\r\r<\/span>ChartID <\/span>= <\/span>GetChartID<\/span>();\r\rVar = <\/span>StaticVarGet<\/span>(<\/span>Sname<\/span>+<\/span>ChartID<\/span>);\r\rreturn Var;\r\r}\r\r<\/span>procedure kStaticVarSetText<\/span>( <\/span>SName<\/span>, <\/span>SValue <\/span>)\r\r{\r\r<\/span>ChartID <\/span>= <\/span>GetChartID<\/span>();\r\r<\/span>InIndicator <\/span>= <\/span>Status<\/span>(<\/span>"Action"<\/span>) == <\/span>1<\/span>;\r\rif( <\/span>InIndicator <\/span>) <\/span>StaticVarSetText<\/span>(<\/span>Sname<\/span>+<\/span>ChartID<\/span>, <\/span>Svalue<\/span>);\r\r}\r\rfunction <\/span>kStaticVarGetText<\/span>( <\/span>SName <\/span>)\r\r{\r\r<\/span>ChartID <\/span>= <\/span>GetChartID<\/span>();\r\rreturn <\/span>StaticVarGetText<\/span>(<\/span>Sname<\/span>+<\/span>ChartID<\/span>);\r\r}\r\rfunction <\/span>MsgCol_Begin<\/span>( <\/span>ColName<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>)\r\r{\r\rglobal <\/span>FontRatio<\/span>, <\/span>ColName<\/span>, <\/span>ColNumber<\/span>;\r\r<\/span>ColNumber <\/span>= <\/span>VarGet<\/span>(<\/span>"ColNumber"<\/span>);\r\rif( <\/span>IsEmpty<\/span>( <\/span>ColNumber <\/span>) ) <\/span>VarSet<\/span>(<\/span>"ColNumber"<\/span>,<\/span>1<\/span>);\r\relse <\/span>VarSet<\/span>(<\/span>"ColNumber"<\/span>, ++<\/span>ColNumber<\/span>);\r\r<\/span>ColName <\/span>= <\/span>ColName<\/span>+<\/span>GetChartID<\/span>();\r\r<\/span>GfxSetOverlayMode<\/span>( <\/span>0 <\/span>);\r\r<\/span>GfxSelectFont<\/span>( <\/span>"Tahoma"<\/span>, <\/span>CellHeight<\/span>\/<\/span>FontRatio<\/span>, <\/span>800 <\/span>);\r\r<\/span>GfxSelectPen<\/span>( <\/span>colorBlack <\/span>);\r\r<\/span>GfxSetBkMode<\/span>( <\/span>1 <\/span>);\r\r<\/span>kStaticVarSet<\/span>(<\/span>"PanelItemNum"<\/span>+<\/span>ColName<\/span>, <\/span>0<\/span>);\r\r<\/span>VarSetText<\/span>(<\/span>"ColName"<\/span>,<\/span>ColName<\/span>);\r\rreturn <\/span>ColNumber<\/span>;\r\r}\r\rfunction <\/span>MsgCol_End<\/span>( )\r\r{\r\rglobal <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelYoffset<\/span>, <\/span>PanelXoffset<\/span>, <\/span>ColNumber<\/span>, <\/span>PanelItemNum<\/span>;\r\r<\/span>ChartIDStr <\/span>= <\/span>NumToStr<\/span>(<\/span>GetChartID<\/span>(),<\/span>1.0<\/span>,<\/span>False<\/span>);\r\r<\/span>ColName <\/span>= <\/span>VarGetText<\/span>(<\/span>"ColName"<\/span>);\r\r<\/span>ULCellX <\/span>= <\/span>PanelXoffset <\/span>+ (<\/span>ColNumber<\/span>-<\/span>1<\/span>) * <\/span>CellWidth<\/span>;\r\r<\/span>LRCellX <\/span>= <\/span>ULCellX <\/span>+ <\/span>CellWidth<\/span>;\r\rfor( <\/span>Row <\/span>= <\/span>1<\/span>; <\/span>Row <\/span>&<\/span>lt<\/span>;= <\/span>PanelItemNum<\/span>; <\/span>Row<\/span>++ )\r\r{\r\r<\/span>ULCellY <\/span>= (<\/span>Row<\/span>-<\/span>1<\/span>) * <\/span>CellHeight <\/span>+ <\/span>PanelYoffset<\/span>;\r\r<\/span>LRCellY <\/span>= <\/span>ULCellY <\/span>+ <\/span>CellHeight<\/span>;\r\r<\/span>TextCell <\/span>= <\/span>kStaticVarGetText<\/span>(<\/span>"TextCell"<\/span>+<\/span>ColName<\/span>+<\/span>Row<\/span>);\r\r<\/span>TextColor <\/span>= <\/span>Nz<\/span>(<\/span>kStaticVarGet<\/span>(<\/span>"TextColor"<\/span>+<\/span>ColName<\/span>+<\/span>Row<\/span>));\r\r<\/span>BackColor <\/span>= <\/span>Nz<\/span>(<\/span>kStaticVarGet<\/span>(<\/span>"BackColor"<\/span>+<\/span>ColName<\/span>+<\/span>Row<\/span>));\r\rif( <\/span>Row<\/span>==<\/span>1<\/span>) <\/span>TextCell <\/span>= <\/span>StrReplace<\/span>( <\/span>TextCell<\/span>, <\/span>ChartIDStr<\/span>, <\/span>""<\/span>);\r\r<\/span>GfxSelectSolidBrush<\/span>( <\/span>BackColor<\/span>);\r\r<\/span>GfxRectangle<\/span>( <\/span>ULCellX<\/span>, <\/span>ULCellY<\/span>, <\/span>LRCellX<\/span>, <\/span>LRCellY <\/span>);\r\r<\/span>GfxSetBkColor<\/span>( <\/span>BackColor<\/span>);\r\r<\/span>GfxSetTextColor<\/span>( <\/span>TextColor <\/span>);\r\r<\/span>GfxDrawText<\/span>( <\/span>TextCell<\/span>, <\/span>ULCellX<\/span>, <\/span>ULCellY<\/span>, <\/span>LRCellX<\/span>, <\/span>LRCellY<\/span>, <\/span>32 <\/span>| <\/span>1 <\/span>| <\/span>4<\/span>);\r\r}\r\r}\r\rfunction <\/span>TextCell<\/span>( <\/span>TextCell<\/span>, <\/span>backColor<\/span>, <\/span>TextColor<\/span>)\r\r{\r\rglobal <\/span>InitializePanels<\/span>, <\/span>PanelVisible<\/span>;\r\r<\/span>ColName <\/span>= <\/span>VarGetText<\/span>(<\/span>"ColName"<\/span>);\r\r<\/span>PanelItemNum <\/span>= <\/span>Nz<\/span>(<\/span>kStaticVarGet<\/span>(<\/span>"PanelItemNum"<\/span>+<\/span>ColName<\/span>))+<\/span>1<\/span>;\r\r<\/span>kStaticVarSet<\/span>(<\/span>"PanelItemNum"<\/span>+<\/span>ColName<\/span>, <\/span>PanelItemNum<\/span>);\r\r<\/span>kStaticVarSet<\/span>(<\/span>"CellState"<\/span>+<\/span>ColName<\/span>+<\/span>PanelItemNum<\/span>, <\/span>False<\/span>);\r\r<\/span>Label <\/span>= <\/span>StrExtract<\/span>(<\/span>TextCell<\/span>,<\/span>0<\/span>);\r\r<\/span>kStaticVarSetText<\/span>(<\/span>"TextCell"<\/span>+<\/span>ColName<\/span>+<\/span>PanelItemNum<\/span>, <\/span>Label<\/span>);\r\r<\/span>kStaticVarSet<\/span>(<\/span>"TextColor"<\/span>+<\/span>ColName<\/span>+<\/span>PanelItemNum<\/span>, <\/span>TextColor<\/span>);\r\r<\/span>kStaticVarSet<\/span>(<\/span>"BackColor"<\/span>+<\/span>ColName<\/span>+<\/span>PanelItemNum<\/span>, <\/span>backColor<\/span>);\r\r}\r\rfunction <\/span>Newpanel<\/span>()\r\r{\r\r<\/span>VarSet<\/span>(<\/span>"ColNumber"<\/span>, <\/span>0<\/span>);\r\r}\r<\/span><\/pre>\n

For those who want to experiment with multi-panel layouts here is the code used to produce the xample shown earlier:<\/p>\n

<\/span>#include\r\r<\/span>global <\/span>ColNumber<\/span>;\r<\/span>_SECTION_BEGIN<\/span>(<\/span>"MESSAGE PANEL 1"<\/span>);\r<\/span>CellHeight                <\/span>= <\/span>Param<\/span>(<\/span>"Cell Height"<\/span>,<\/span>20<\/span>,<\/span>5<\/span>,<\/span>200<\/span>,<\/span>1<\/span>);\r<\/span>CellWidth                 <\/span>= <\/span>Param<\/span>(<\/span>"Cell Width"<\/span>,<\/span>120<\/span>,<\/span>5<\/span>,<\/span>200<\/span>,<\/span>1<\/span>);\r<\/span>PanelYoffset             <\/span>= <\/span>Param<\/span>(<\/span>"Cell Row Offset (px)"<\/span>,<\/span>10<\/span>,<\/span>0<\/span>,<\/span>Status<\/span>(<\/span>"pxheight"<\/span>),<\/span>1<\/span>);\r<\/span>PanelXoffset            <\/span>= <\/span>Param<\/span>(<\/span>"Cell Column Offset (px)"<\/span>,<\/span>10<\/span>,<\/span>0<\/span>,<\/span>Status<\/span>(<\/span>"pxwidth"<\/span>),<\/span>1<\/span>);\r<\/span>FontRatio               <\/span>= <\/span>Param<\/span>(<\/span>"Font:CellHeight ratio"<\/span>,<\/span>2<\/span>,<\/span>1<\/span>,<\/span>20<\/span>,<\/span>0.1<\/span>);\r\r<\/span>MsgCol_Begin<\/span>( <\/span>"COLUMNNAME  1"<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>);\r<\/span>TextCell<\/span>( <\/span>"PANEL 1"<\/span>, <\/span>colorBlack<\/span>, <\/span>colorWhite<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 2"<\/span>, <\/span>2<\/span>, <\/span>3<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 3"<\/span>, <\/span>8<\/span>, <\/span>4<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 4"<\/span>, <\/span>7<\/span>, <\/span>5<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 5"<\/span>, <\/span>4<\/span>, <\/span>6<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 6"<\/span>, <\/span>3<\/span>, <\/span>7<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 7"<\/span>, <\/span>2<\/span>, <\/span>8<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 8"<\/span>, <\/span>9<\/span>, <\/span>2<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 9"<\/span>, <\/span>8<\/span>, <\/span>3<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 10"<\/span>, <\/span>7<\/span>, <\/span>4<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 11"<\/span>, <\/span>6<\/span>, <\/span>5<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 12"<\/span>, <\/span>5<\/span>, <\/span>6<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 13"<\/span>, <\/span>4<\/span>, <\/span>7<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 14"<\/span>, <\/span>3<\/span>, <\/span>8<\/span>);\r<\/span>MsgCol_End<\/span>();\r<\/span>_SECTION_END<\/span>();\r\r<\/span>_SECTION_BEGIN<\/span>(<\/span>"MESSAGE PANEL 2"<\/span>);\r<\/span>CellHeight                <\/span>= <\/span>Param<\/span>(<\/span>"2Cell Height"<\/span>,<\/span>20<\/span>,<\/span>5<\/span>,<\/span>200<\/span>,<\/span>1<\/span>);\r<\/span>CellWidth                 <\/span>= <\/span>Param<\/span>(<\/span>"2Cell Width"<\/span>,<\/span>120<\/span>,<\/span>5<\/span>,<\/span>200<\/span>,<\/span>1<\/span>);\r<\/span>PanelYoffset             <\/span>= <\/span>Param<\/span>(<\/span>"2Cell Row Offset (px)"<\/span>,<\/span>10<\/span>,<\/span>0<\/span>,<\/span>Status<\/span>(<\/span>"pxheight"<\/span>),<\/span>1<\/span>);\r<\/span>PanelXoffset            <\/span>= <\/span>Param<\/span>(<\/span>"2Cell Column Offset (px)"<\/span>,<\/span>10<\/span>,<\/span>0<\/span>,<\/span>Status<\/span>(<\/span>"pxwidth"<\/span>),<\/span>1<\/span>);\r<\/span>FontRatio               <\/span>= <\/span>Param<\/span>(<\/span>"2Font:CellHeight ratio"<\/span>,<\/span>2<\/span>,<\/span>1<\/span>,<\/span>20<\/span>,<\/span>0.1<\/span>);\r\r<\/span>Newpanel<\/span>();\r<\/span>MsgCol_Begin<\/span>( <\/span>"COLUMNNAME  1"<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>);\r<\/span>TextCell<\/span>( <\/span>"PANEL 2"<\/span>, <\/span>1<\/span>, <\/span>colorWhite<\/span>);\r<\/span>MsgCol_End<\/span>();\r<\/span>MsgCol_Begin<\/span>( <\/span>"COLUMNNAME  1"<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message B"<\/span>, <\/span>2<\/span>, <\/span>1<\/span>);\r<\/span>MsgCol_End<\/span>();\r<\/span>MsgCol_Begin<\/span>( <\/span>"COLUMNNAME  1"<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message C"<\/span>, <\/span>4<\/span>, <\/span>colorWhite<\/span>);\r<\/span>MsgCol_End<\/span>();\r<\/span>MsgCol_Begin<\/span>( <\/span>"COLUMNNAME  1"<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message D"<\/span>, <\/span>5<\/span>, <\/span>colorWhite<\/span>);\r<\/span>MsgCol_End<\/span>();\r<\/span>MsgCol_Begin<\/span>( <\/span>"COLUMNNAME  1"<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message E"<\/span>, <\/span>4<\/span>, <\/span>colorWhite<\/span>);\r<\/span>MsgCol_End<\/span>();\r<\/span>MsgCol_Begin<\/span>( <\/span>"COLUMNNAME  1"<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message F"<\/span>, <\/span>5<\/span>, <\/span>colorWhite<\/span>);\r<\/span>MsgCol_End<\/span>();\r<\/span>_SECTION_END<\/span>();\r\r<\/span>_SECTION_BEGIN<\/span>(<\/span>"MESSAGE PANEL 3"<\/span>);\r<\/span>Newpanel<\/span>();\r<\/span>CellHeight                <\/span>= <\/span>Param<\/span>(<\/span>"1Cell Height"<\/span>,<\/span>20<\/span>,<\/span>5<\/span>,<\/span>200<\/span>,<\/span>1<\/span>);\r<\/span>CellWidth                 <\/span>= <\/span>Param<\/span>(<\/span>"1Cell Width"<\/span>,<\/span>120<\/span>,<\/span>5<\/span>,<\/span>200<\/span>,<\/span>1<\/span>);\r<\/span>PanelYoffset             <\/span>= <\/span>Param<\/span>(<\/span>"1Cell Row Offset (px)"<\/span>,<\/span>10<\/span>,<\/span>0<\/span>,<\/span>Status<\/span>(<\/span>"pxheight"<\/span>),<\/span>1<\/span>);\r<\/span>PanelXoffset            <\/span>= <\/span>Param<\/span>(<\/span>"1Cell Column Offset (px)"<\/span>,<\/span>10<\/span>,<\/span>0<\/span>,<\/span>Status<\/span>(<\/span>"pxwidth"<\/span>),<\/span>1<\/span>);\r<\/span>FontRatio               <\/span>= <\/span>Param<\/span>(<\/span>"1Font:CellHeight ratio"<\/span>,<\/span>2<\/span>,<\/span>1<\/span>,<\/span>20<\/span>,<\/span>0.1<\/span>);\r\r<\/span>MsgCol_Begin<\/span>( <\/span>"COLUMNNAME  1"<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>);\r<\/span>TextCell<\/span>( <\/span>"PANEL 3"<\/span>, <\/span>colorBlack<\/span>, <\/span>colorWhite<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 22"<\/span>, <\/span>2<\/span>, <\/span>3<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 23"<\/span>, <\/span>8<\/span>, <\/span>4<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 24"<\/span>, <\/span>7<\/span>, <\/span>5<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 25"<\/span>, <\/span>4<\/span>, <\/span>6<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 26"<\/span>, <\/span>3<\/span>, <\/span>7<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 27"<\/span>, <\/span>2<\/span>, <\/span>8<\/span>);\r<\/span>MsgCol_End<\/span>();\r\r<\/span>MsgCol_Begin<\/span>( <\/span>"COLUMNNAME  2"<\/span>, <\/span>CellHeight<\/span>, <\/span>CellWidth<\/span>, <\/span>PanelXoffset<\/span>, <\/span>PanelYoffset <\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 28"<\/span>, <\/span>9<\/span>, <\/span>2<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 29"<\/span>, <\/span>8<\/span>, <\/span>3<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 30"<\/span>, <\/span>7<\/span>, <\/span>4<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 31"<\/span>, <\/span>6<\/span>, <\/span>5<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 32"<\/span>, <\/span>5<\/span>, <\/span>6<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 33"<\/span>, <\/span>4<\/span>, <\/span>7<\/span>);\r<\/span>TextCell<\/span>( <\/span>"Text Message 34"<\/span>, <\/span>3<\/span>, <\/span>8<\/span>);\r<\/span>MsgCol_End<\/span>();\r<\/span>_SECTION_END<\/span>();<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"

Also see Moving Low Level Graphics (GFX) Objects on your Charts This first post introduces you to the basic techniques on how to create a matrix of text cells to display messages and system status on your chart. At this stage the cells are not mouse-click sensitive; this and other features will be added later. […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[134],"tags":[],"_links":{"self":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts\/1633"}],"collection":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/comments?post=1633"}],"version-history":[{"count":2,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts\/1633\/revisions"}],"predecessor-version":[{"id":1928,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts\/1633\/revisions\/1928"}],"wp:attachment":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/media?parent=1633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/categories?post=1633"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/tags?post=1633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}