Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

Re: Re: How to show left text for boolean field control?

Integrated Application Platform › Forums › General › How to show left text for boolean field control? › Re: Re: How to show left text for boolean field control?

September 11, 2014 at 2:35 am #1108
jaska_lee
Participant

thanks andrew, I have modified two standard objects and it now seems to be working as I expected.

1) CheckBoxPairControl
Following changes make the text show on the left for CheckBox control.

	PassthruController{
Name: 'CheckBoxPair'
New(prompt, checkbox, hidden = false) // old: (checkbox, prompt, hidden = false)
{
super(.layout(prompt, checkbox, hidden)) // old: (checkbox, prompt, hidden)
c = .Horz.GetChildren()

// old
//.box = c[0]
//.text = c[2]
//.Ymin = .box.Ymin
//.Top = .box.Top
// old

// new
.text = c[0]
.box = c[2]
.Ymin = .text.Ymin
.Top = .text.Top
// new
}
layout(prompt, checkbox, hidden) //old: (prompt, checkbox, hidden)
{
text = Object('Static', prompt, notify:, hidden: hidden)
for m in #(font, size, weight)
if checkbox.Member?(m)
text[m] = checkbox[m]

//old: return Object('Horz', checkbox, #('Skip', 3), text)
return Object('Horz', text, #('Skip', 3), checkbox)
}
Get()
{
.box.Get()
}
Set(val)
{
.box.Set(val)
}
SetFocus()
{
.box.SetFocus()
}
BnSetFocus()
{
.text.DrawFocusRect(true)
}
BnKillFocus()
{
.text.DrawFocusRect(false)
}
Static_Click()
{
if .box.GetEnabled()
{
.box.SetFocus()
.box.Set(not .box.Get())
.box.BN_CLICKED()
}
}
}

2) Construct method in Control object
On Access control, I could not make the text align with the rest of the textboxes. But if I comment out the code concerning ‘prompt isn’t greyed’ for CheckBox, it aligns with others nicely and prompt isn’t greyed in protect mode. Is it safe to do it like this?

	Construct(@x)
{
if (x.Size() is 1 and x.Member?(0) and Object?(x[0]))
x = x[0]
if (x[0] is 'NoPrompt' and String?(x[1]) and x[1] =~ "^[_a-z]")
{
c = x
x = Datadict(x[1]).Control.Copy().Add(x[1] at: 'name')
for m in c.Members()
if String?(m)
x[m] = c[m]
}
else if (String?(x[0]) and x[0] =~ "^[_a-z]")
{
name = x[0]
dict = Datadict(name)
x = dict.Control.Copy()
hidden = false
if .Custom isnt false and .Custom.Member?(name)
{
x.Merge(.Custom[name])
hidden = .Custom[name].GetDefault('hidden', false)
}
x.name = name
if "" isnt prompt = Prompt(name)
{
//if x[0] is 'CheckBox'
//x = Object('CheckBoxPair', x, prompt, hidden: hidden)
// need this so prompt isn't greyed when protected
//else
x = Object('Pair', Object('Static', prompt, hidden: hidden), x)
}
}
_parent = this
_ctrlspec = x
ctrl = Construct(x, "Control")
if (ctrl.Name > "")
this[ctrl.Name] = ctrl
return ctrl
}

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • Alpha copy of gSuneido to play with
  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo

Contact Us | Legal Statement | Privacy Statement | SiteMap

Copyright © 2023 Axon® Development Corporation. All Rights Reserved. - Open Source Integrated Database and Programming Language