ButtonTiles Class

Yeah, weird!

I am not sure if it is the RTL or if it is Windows but when I run the example in a text virtual machine (Win-Vista) I see the same symptoms.
I tried a few different images and a PNG file seems to be the cleanest but still has weirdness. See image:

My best guess at the moment is that Win10 is better at scaling the ico/image files somehow?

I also tried setting a specific width/height to the image control but no luck with that either.

Quite annoying!

Perhaps some more fiddling around with image types/dimensions will find something that works more consistently?
Could it be a bug in the Clarion RTL?

Hello Brahn,

I stumbled across this ButtonTileClass, its a really nice one.

Is there a chance to have a demo being an .APP - for dumbos like me?

Or maybe another topic, like “How to make and run a Clarion-project being a non-APP”, to solve that once and for all times. :smiley:

UPDATE:
I downloaded all these .CLW and .CWPROJ and all other stuff one by one, but when I tried to open the .SLN or the .CWPROJ, I got “This is not a valid Clarion Projectwhatever-file” error.

I do a mistake, apparently. Hence my favor of .APP… :smiley:

tia
Wolfgang

Good idea! Perhaps also as part of that a series on using git too :slight_smile:
The problem with apps is backwards compatibility so, like you say, better to solve the root problem. I will try to get something started tonight.

oh yes, oh yes, oh yes!

1 Like

Ok, I made a start:

How To: Create a Non-App Clarion project?

I will update here as I add more. Of course if anyone else wishes to contribute please do! I recommend using the docs category for now. If we get a bunch of these and it makes sense then we can look at creating a more specific category.

Gah, I made the other one too!

How To: Open a Non-App Clarion project?

@brahn

I’m having some issues implementing this in a multi dll solution.

Your example works fine.

It works fine in the data dll but the moment I include it in one of the other dlls I get compiler errors.

I’ve done the include in the App’s global includes which is fine.

INCLUDE('ButtonTile.inc'),ONCE
INCLUDE('TileManager.inc'),ONCE

The moment I implement the object in the procedure

Tiles           TileManager

I’m getting these compiler errors.

Unresolved External TYPE$TILEMANAGER 
Unresolved External VMT$TILEMANAGER 
Unresolved External CONSTRUCT@F11TILEMANAGER 
Unresolved External DESTRUCT@F11TILEMANAGER 

Any thoughts?
Bertus

Probably need to set the link and dll attributes in the class properly. I was lazy and hard coded them because I was using it in a single exe. Submit a PR to the github repo if you can!

Oh wait, I just looked and they use the _ABCLinkMode_ and _ABCDllMode_ so that should work. Do you have those defines? Which version of clarion?

It’s the latest release of C10 12799. I have those defined. If got another class which I wrote for auto completing with the same defines and that is working without problem.

The other strange thing I found is that your classes are not showing up in the ABC Class Viewer. I did move it to the Clarion10\accessory\libsrc\win folder.

The only reference I’m getting on VMT is the Virtual method table in Russ’ Book: https://books.google.com.au/books?id=Loo8iIBDOdcC&pg=PA36&dq=CLARION+VMt&hl=en&sa=X&ved=0ahUKEwihjffqpvDbAhUIx7wKHfwwBiUQ6AEIKTAA#v=onepage&q=CLARION%20VMt&f=false

How about if you add this the first line of the inc files:

!ABCIncludeFile

It is mentioned in the help file too in fact. In these three sections:

  • IMPLEMENTS(add methods to a CLASS)
  • Implementing of INTERFACEs in Derived Classes
  • Module Definition Files (.EXP Files), Exporting CLASSes

It’s this last one that seems to be most relevant, and should be fixed by including the !ABCIncludeFile

Exporting CLASSes

Exporting CLASS declarations requires a special form of export definition.

You must create two export definitions for the CLASS itself. The first begins with VMT$ followed by the name of the CLASS as the entryname. The second begins with TYPE$ followed by the name of the CLASS as the entryname. These are followed by an export definition for each method in the CLASS to export whose pwords must begin with the name of the CLASS as the first parameter.

For example:

EXPORTS
VMT$MYCLASS @?
TYPE$MYCLASS @?
FIRSTMETHOD@F7MYCLASS @?
SECONDMETHOD@F7MYCLASS @?

Adding the !ABCIncludeFile seemed to do the trick.

I wasn’t trying to export the class anyway.

If refactored your ButtonTile to TileButton just to put them together alphabetically.

I’ve put a template together for it as well, just to make the implementation smoother. The template uses the button’s background property as the Tile background.

You are welcome to have a look here and merge back to your Github if you are happy with the changes.

It looks like the class has a problem with the Clarion resizer functionality.

Hello, could someone upload an example of the use of the class using an .app with CLarion 11? I compiled the project and it works fine, but I want to test the class in an app, I never worked with classes and I want to learn, if someone could give me a hand I would be very grateful!

declare your class in global embeds (for example in After Global Data embed), like this

MyClass CLASS
f1        STRING(20)
        END

then in code you can call
MyClass.f1 = 'Martin'

In that case you can manually call TileManager.WindowComponent.Reset(1) when windows event is
resizing, I think the equate for resizing is 561 and/or 1023. After that, the buttons/tiles is resized according to
resizer…
For example, if you declate it like; tiles TileManager, then in embed of TakeWindowEvent, on 5001, right after parrent call use something like this:
case event()
of 1023 orof 561
tiles.WindowComponent.Reset(1)
END

Is there a reason why you’re not using the equates?

Pure laziness… hehehe

Using the class, the enter key doesn’t work any more on field navigation…
Is there some workaround, this class is so great