Skip to content

Instantly share code, notes, and snippets.

@bayramcetin
Created March 14, 2023 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bayramcetin/3f7712cd680110640e1c7d005192d405 to your computer and use it in GitHub Desktop.
Save bayramcetin/3f7712cd680110640e1c7d005192d405 to your computer and use it in GitHub Desktop.
RGB Color Form
[Form]
public class ETGCashFlowColorParameters extends FormRun
{
void setBackColor(OLE_Color _color)
{
ETGCashFlowTypes.BackColor = _color;
ETGCashFlowTypes_ds.write();
element.refreshColorView();
}
void setTextColor(OLE_Color _color)
{
ETGCashFlowTypes.TextColor = _color;
ETGCashFlowTypes_ds.write();
element.refreshColorView();
}
void refreshColorView()
{
ETGCashFlowTypes table;
for (table = ETGCashFlowTypes_ds.getFirst();
table;
table = ETGCashFlowTypes_ds.getNext())
{
if (table.RecId == ETGCashFlowTypes.RecId)
{
ETGCashFlowTypes_ds.clearDisplayOption(table);
}
}
ETGCashFlowTypes_ds.refreshEx(-1);
ETGCashFlowTypes_ds.active();
}
[DataSource]
class ETGCashFlowTypes
{
/// <summary>
///
/// </summary>
/// <param name = "_record"></param>
/// <param name = "_options"></param>
public void displayOption(Common _record, FormRowDisplayOption _options)
{
ETGCashFlowTypes table = _record;
_options.affectedElementsByControl(FormGridControl1_BackColor.id());
_options.affectedElementsByControl(FormGridControl1_TextColor.id());
_options.textColor(table.TextColor);
_options.backColor(table.BackColor);
super(_record, _options);
}
}
[Control("Integer")]
class FormGridControl1_BackColor
{
/// <summary>
///
/// </summary>
public void lookup()
{
//super();
int currentColor = ETGCashFlowTypes.BackColor;
int selectedColor = ColorSelection::selectColor(this, currentColor);
if (selectedColor != currentColor)
{
element.setBackColor(selectedColor);
}
}
}
[Control("Integer")]
class FormGridControl1_TextColor
{
/// <summary>
///
/// </summary>
public void lookup()
{
//super();
int currentColor = ETGCashFlowTypes.TextColor;
int selectedColor = ColorSelection::selectColor(this, currentColor);
if (selectedColor != currentColor)
{
element.setTextColor(selectedColor);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment