Support Board
Date/Time: Wed, 05 Feb 2025 12:41:20 +0000
[User Discussion] - Let's create GUI #defines together ?
View Count: 1307
[2014-12-03 16:59:47] |
zencoder - Posts: 10 |
Hi everybody. I am not sure that it will be interesting for all developers, so at first let me ask community: is it really need? In a short words - I create some #define which helps me write source codes more quickly and clearly. For example, creating text panel consists of repeatable rows, so I wrote #define Text_Create(t, ln) \ s_UseTool t; \ t.LineNumber = (ln); \ t.AddMethod = UTAM_ADD_OR_ADJUST; \ t.DrawingType = DRAWING_TEXT; \ t.MultiLineLabel = true // x-scale in % in SC using [0...150] scale, but I prefere [0...100] #define Text_MoveToXY(t, x, y) \ { t.UseRelativeVerticalValues = 1; \ t.BeginDateTime = (x)*1.50; \ t.BeginValue = (y); \ sc.UseTool(t); } and now, instead of this 10 lines write only 2 Text_Create(Panel1, 1254);
and obtain Text label at the top left corner of screen.Text_MoveToXY(Panel1, 1, 100); Details and source codes can be found here: - Defines: http://algotrading.solutions/sierrachart/sourcecodes/gui - Simple study, using them: http://algotrading.solutions/sierrachart/sourcecodes/daysdividers I prepare only those defines, which I need right now. May be someone would like to add them with his own defines, and we can collect really full GUI "library"? So what community think? Date Time Of Last Edit: 2014-12-03 18:51:27
|
[2014-12-03 18:43:40] |
ejtrader - Posts: 688 |
Second this approach :) I use something similar on these lines - mainly to avoid the repeating code multiple places ( by storing it in library and including them as needed ). Thanks |
[2014-12-03 23:02:53] |
ertrader - Posts: 681 |
Yes...this looks very clean. I do like it.
|
To post a message in this thread, you need to log in with your Sierra Chart account: