Login Page - Create Account

Support Board


Date/Time: Wed, 05 Feb 2025 12:54:36 +0000



Post From: Let's create GUI #defines together ?

[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);  
  Text_MoveToXY(Panel1, 1, 100);
and obtain Text label at the top left corner of screen.

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