Subwindow Widgets in Omnis Studio (was: Displaying icons in a complex grid)

Vik Shah Vik at Keys2Solutions.com.au
Tue Mar 3 04:05:00 EST 2015


Hey Bas,

> - the inability to define properties, this is an enhancement I've put
> into TigerLogic many moons ago but I'd like to add custom properties to
> my subwindow that I can actually set during design time with the
> property manager. Now I have to set those by code

A while back I came across someone’s code that had an ingenious trickery in it... It was so simple that I really wonder why didn’t I think of that. 

To assign a property of any object, one must, $cinst.$objs.someObject.$left.$assign(10)

In the case where the sub-window is a single field or not overly complex, have a bunch of methods in it like…
$left.$assign
$top.$assign
$height.$assign
$width.$assign
etc...

Then to resize or call any method of your sub window, 
$cinst.$objs.mySubWindow.$left.$assign(10)
$cinst.$objs.mySubWindow.$top.$assign(2)
etc...

fake properties and methods... =)

Regards,

Vik Shah
Director
Keys2Solutions 


> On 3 Mar 2015, at 14:20, Bastiaan Olij <bastiaan at basenlily.me> wrote:
> 
> Hi Mischa,
> 
> Nice writeup!
> 
> I've gone to a mix of using this technique (and have created many fun
> little widgets since EurOmnis) and putting things in XCOMPs.
> The biggest issues I've found in using this are:
> - there is a performance penalty if you use it alot. I think this is
> definitely a problem if they ever make it possible on complex grids
> - its hard to move the focus into the right field. You have to call a
> method on the subwindow that then sets the focus on the first field
> within the subwindow
> - the inability to define properties, this is an enhancement I've put
> into TigerLogic many moons ago but I'd like to add custom properties to
> my subwindow that I can actually set during design time with the
> property manager. Now I have to set those by code
> 
> As for XCOMPs, I've been slowly tinkering away at an open source
> framework which is available on my github page including an open source
> widgets library for which I've also put binaries for Studio 6 online. It
> doesn't include many widgets yet and there are one or two I really would
> like to redo as I've learned more about the SDK and how not to do
> certain things but its working:)
> 
> One thing that I'm particularly proud of is a drop down control that
> shows a list of fonts and draws them in that font.
> Anyway here's the link: https://github.com/BastiaanOlij/omnis.xcomp.widget
> 
> Cheers,
> 
> Bas
> 
> On 3/03/2015 1:56 pm, Mischa wrote:
>> Dear all,
>> 
>> I've placed an article and a demo library about creating your own window components on my website:
>> 
>> http://www.omnislab.com/omnis-studio/technical-notes-for-omnis-studio/subwindow-widgets-create-your-own-window-components
>> 
>> I'm using the trick I learned from Bas (also outlined in TNGI0018) to set a variable as  dataname in a subwindow object, and access it within the subwindow. With a few tricks you can have a full implementation of the $dataname property, this means reading its contents and also changing it within the subwindow. These 'widgets' act like native Studio components, and are as easy to handle as an entry field - you drag it into your window, assign a variable and optionally parameters - that's all you need to do.
>> 
>> The possibilities are terrific - whatever window component you are missing - go and build it on your own.
>> 
>> The only limitation at the moment - subwindow widgets don't work in complex grids. The reason why is very complicated; the paradigms of complex grids and subwindows bite each other in some aspects. Anyway, with the help of TL Germany, I issued an enhancement request to fix this problem - hopefully it finds an opened ear ;)
>> 
>> Best greetings and thanks for your replies!
>> Mischa
>> 
>> PS @ Sam - the idea of creating an icon font is very creative ;) - however creating a font is a hell of work (I did it already) and requires sophisticated and expensive software. Colored fonts are possible, but not really supported on any platform, but this might change in the future.
>> 
>> ---------------------------------------------------
>>  T H E   O M N I S   L /\ B     www.omnislab.com
>> ---------------------------------------------------
>> 
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
>> 
>> 
> 
> 
> -- 
> Kindest Regards,
> 
> Bastiaan Olij
> e-mail: bastiaan at basenlily.me
> web: http://www.basenlily.me
> Skype: Mux213
> http://www.linkedin.com/in/bastiaanolij
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com




More information about the omnisdev-en mailing list