How to add a “Resize Image” Procedure in Clarion 7

Yesterday I was adding "Internet Profile" functionality for Users. That is, a Description and Image can be entered in the back-end which will then show on the public website, under "Our Team".

Getting the image into my file structure (within the web folder) was no problems (have it in a number of places for all kinds of media), but Profile images have an important rule:

  • They must be small.

And then a second, more general, rule occurred to me.

  • Standardise ALL images uploaded into the system.

With these in mind I opened up my Data DLL app and got to work.

First things first. Two global templates have to be added before going any further.

1. The Clarion FreeImage template.

23-04-2010-1-36-16-PM

And 2. The Capesoft Draw global template.

23-04-2010-1-37-32-PM

As you can see, in the Options tab of the Draw global template dialogue, we’ve ticked the "Use DrawImage Functionality" checkbox. IMPORTANT!

Then we get onto creating the procedure.

I wanted to pass the Source and Destination paths (eg. c:\\images\\profile.png), and the Max Width and Height. That’s it.

Oh! And because it’s good practice in my books, I’ve got a return variable.

23-04-2010-1-37-57-PM

Then we open up the Window and add the Draw control (from the Control Templates pad).

23-04-2010-1-42-40-PM

And finally we come to the code. The rule is to make sure the code is called AFTER the Window is opened. I’ve made a routine and called it in the "After Window Opened" embed.

ResizeImage routinedataimage:Width longimage:Height longimage:BitDepth longimage:Type longcode!-! Init!—-if not Drawer4.useDrawImageDrawer4.InitDrawImage()endDrawer4.Blank(COLOR:White)Drawer4.diGetImageInfo(pSourcePath,image:Width,image:Height,image:BitDepth,image:Type)Drawer4.BestFit(image:Width,image:Height,Drawer4.width,Drawer4.height,image:Width,image:Height)Drawer4.Resize(image:Width,image:Height)Drawer4.diReadImage(pSourcePath, 1 + (Drawer4.width-image:Width)/2, 1 + (Drawer4.height-image:Height)/2, image:Width, image:Height)Drawer4.Display()Drawer4.WritePNG(pDestPath)post(EVENT:CloseWindow)

(Edit: Some changes made thanks to Sean (from Capesoft) in comment below. Thanks Sean!)

This code will take in your image, resize it to "best fit" within the Max Width and Height you passed, and save it to the Destination Path as a PNG image file.

Fantastic!

Late To The Party

I know, I’ve come very late to the party.

Back in May, Bob Foreman posted http://www.softvelocity.net/community/blogs/clarion_news/archive/2007/05/03/1635.aspx this little wonder on Vista and Clarion 6.

Both things I had never bothered to try and fix, because I figured Vista was magical and I’d heard these things were just the way it was. I’m very inquisitive .. not.

1. The massive borders in Vista, Aero-Glass styling. This is obviously changeable. Makes a big difference. I changed them to a 1 size.

2. The Help file issue. This has miffed me no end. Turns out, following the steps Bob lays down allows me the glory days of F1 in Clarion 6. For the times when I needed it, i really missed it.

clarionhelpvista-001

The TooMany Bobs Productions

There has been quite a bit of activity on the Soft Velocity blog of late. And it’s highlighted with a number of videos. These are showing particular aspects of Clarion 7.

Taking the time, I found, to watch them with Clarion 7 open so you can go and see exactly what is being talked about, is quite valuable.

With Jaymoe development, I decided to use Clarion 7 as my text editor. With a new pc in tow, running Vista, and not wanting to bring across my UltraEdit .. it has proved a success.

One detail was bugging me. Strange behaviour was occurring with the tabbing and indentation. Couldn’t for the life of me work out why the editor wanted to move my stuff around.

Of course, after watching the Tools video tonight, the issue was clear. I need to change my tabbing to "Automatic", from "Smart". And further, an F1 press for Help reveals ..

Indentation
There is three modes of indentation available in the Text Editor:

None
Set this to turn off all indentation effects.

Automatic
With Indentation set to Automatic ,the Text Editor keeps a running indent. When you press the Enter key, spaces and tabs are inserted to line up the insert point under the start of the previous line.

Smart
After a keyword statement, the next line is indented by the tab size set above. After certain keywords (break, return etc.) the next line is "non-indented".

Other rules for Smart include

  • Indent statements from the CODE keyword position (default = on)

  • Treats any expression that ends with a colon ":" as a label in the CODE section (default = off, where colons are treated as an actual procedure call)

  • Indent a line after the Enter is pressed at the end of the line (default = on)

  • Indent pasted text if several lines were pasted (default = false)

  • Preferred column number (if the keyword should not be indented relative to the parent it will be placed to the preferred column, default = column 21)

  • Indent comments (default = off)

There you go. Not bad. I’ll probably give it a whirl once the appgen comes along and I get full swing into embed coding.

Of course, just realised I can also Snagit ..

image-0002

Ahhh, that’s why _Behaviour_ comes up misspelt in Live Writer .. it’s not the _right_ way of spelling. Ha ha.

Anyway, don’t forget to barrack for the Wallabies ..

A Picturesque View

This may be a boring post for some.

 

A Long, Boring,

Picturesque Drive

Through A Lot Of

Screens

 

Read On ..

I’m going to walk through a bunch of screenies, maybe commenting a little as we go along. Kind of like a Saturday Night Family Slideshow with friends, where the Dad thinks it’s really cool, and everyone else is throwing popcorn around, or trying to get the attention of a really cute neighbour girl.

Yes.

image-0042 

Of course, it would seem appropriate to read the readme. And you know, I actually did, but for the purposes of this comment .. pretend i said this instead .. "Readme. Pffffff."

image-0043

The actual Readme. Some notes, words, that kind of thing.

image-0044

Here we go. Kaboom.  It has begun. Nice to see the build number at the end of the version. Or at least, that’s what it looks like to me.

2450 Builds. Or Compiles. Compiles .. that’s a lot of compiling. Which begs the question (similar to one about a heavy rock and the Almighty), do the makers of Clarion compile the new Clarion in Clarion?

image-0045

Yes, I am indeed going to go through each and every screen that I captured. Suckers!

image-0046

I thought it interesting, the "REMINDER NOTE".

image-0047

One of the more boring slides. No wildlife whatsoever.

image-0048

Hands up if you changed this?

image-0049

I wonder if anyone didn’t make the Disk Space Requirements .. ha ha.

image-0050

Boom. Installing. ICSharpCode .. that sounds something like .. C .. Sharp .. Sharp Develop .. hmmmm.

image-0051

Okay. Done. Let’s see what we can see. But first ..

image-0052
I figure by this far down the page, it will be okay to have a slightly wider than normal piccie.

Anyway, this is the guide. It’s pretty handy, and nice that SV took the time to put it together.

What I am wondering is, did they use Doctor Explain to make the help file? Or is it just that Help and Manual output looks the same?

image-0053

Here we go. The new startup splash-splash page.

Kind of blue. Which is good, helps the memory. The yellow and red .. not sure about yet. Good to see the pyramid made an appearance.

image-0054

And here we are. A sight most of us have been longing for .. for .. a long time. Initial gut reaction on seeing this window, which I saw at devcon .. was .. Oh Baby Finally Yes!

Next thought was .. PROPER CODE EDITOR .. WHOOOOOOT!

image-0055

Starting a new project, shades of learning how to use DirectX and MSVC++6.

image-0056

Note the ‘Awesome’ in the name means this app will truly be .. Awesome.

image-0057

And here we have it. The main interface. Of course, it’s shrunk for picture taking size. Normally the main frame would be a lot larger.

Love the code coloring. Although not sure why 2 gets to be pink, and :44 doesn’t in the time. Offended much.

image-0058

This was a little bit of cool. Further with ..

image-0059

Choosing the File Driver.

image-0060

Urg. So many useless screenshots. But I did warn you.

image-0061

Waaaahooooooo. I am a success! Well, at least, my building a project was a success.

image-0062  

Okay, here’s my windows bar. The more I see the new Clarion Logo, the more I like it. Much better for when you forget to add your own. Better looking than the "it’s so eighties" blue triangle, heh heh.

image-0063

Here i’ve exported the example School app in C6, and importing it into C7. "Parsing" means it’s translating it into ParselTongue, obviously because Clarion 7 was created at Hogwarts, by kids like Harry Potter. Obviously.

image-0064

I really have to check out the documentation that has the shortcut keys. Cause my wonderful F7 doesn’t do what it used to .. <sniff>. At least, I think it doesn’t do .. i might be wrong.

image-0065

A nice big view of the debugger. This is the C7 debugger. Been recompiled, round-ee edges and the like. Same stuff though on the inside I believe.

image-0066

What is this? Why, it looks like the School app, all C7’d.

My problem is, that I obviously haven’t done some things in C6 right. There’s the background coloring issues (transparency forgotten, or something). And probably a bunch of other stuff.

image-0067

A browse in the School app. I realise now, it doesn’t make much sense to look at these without some comparison.

| Last Name | First Name | Address |

———————————————-

| Andrews    | Stuart        | Xaviers Mansion |

There you go. See the difference?

Heh heh, at least I make myself laugh.

image-0068   

This is C6. Perhaps I went back and tried again.

image-0069

Yes, I must have. How my memory fades with each passing day.

In the new patch (es?) for C6, this stuff is brought in. "Link Generated Manifest in Project" is pretty important for having it work in C7 I believe.

image-0070

Here is me, importing in C7.

image-0071

Okay, now I’m taking a gander at the Dictionary. Why did I take a screenie with nothing in it? Hmmm. That’s happened before.

image-0072

Okay, here we go. You can see some of the layout. Fields, Keys, Triggers, Relations, Alias stuff .. all on the lhs .. and then tabs on the rhs, with all the wonders of the world to change. Except you can’t. Not now. Read only. READ ONLY.

image-0073

And last, another different shot of the Dictionary. Here’s what a key looks like.

.Finis.

And there you have it. The most boring trip through C7 in the history of C7. Which isn’t very old. Which probably gives hope that others will come along with more boring trips. Although that might be hard, considering the number of blogs, divided by the probability of ..

Gah.

Hope someone got something out of this. Even if it’s a giggle.  

The Good-Looking Cousin Has Arrived

The more I think about it, the more Clarion .NET excites me.

But for the moment, I am content to gaze upon the wonderful glory of a new IDE .. Clarion 7 (Beta) has made it to my doorstep.

It was a strange surreal moment. This was no doubt due to my being up at 3 am living on caffiene and not much else. But also, it was because the email finally arrived, gtalk popped a little message up .. and I couldn”t do anything but install.

I”m not really interested in recompiling my old apps just yet. More, I wanted to just get a feel for the new IDE.

I”ve got an actual review coming. Snagit got a workout last night. But until then, here”s my prognosis.

  • The IDE is good.
  • The icon will take a while getting used to, simply because it”s not the blue triangle.
  • The code editor is simply gold. Love it. This is where I”ll be doing my best work. And this is what I want to be really good. And it is.
  • The dictionary (read only) is okay. A little slow to load certain things. I remember this was the case at the Aussie DevCon. Not sure why this is, but I”m sure the guys are well aware of it.
  • I”m a fan of the ms project layout. I like all the IDE bits and piece, menus here and there, folding away, being able to walk through the files, that sort of thing. Elements that users of MS stuff have had for a while. It”s going to make Clarion such a superior product. In my opinion.
  • Don”t have Vista, so can”t get a look at the Vista styles/manifests. Recompiled the School app, but didn”t notice much difference. Not sure if I did everything right though. As mentioned above, it was late. I was tired. And reading documentation is for the well-rested. Ha ha.

Anyway. Nuff said. Almost did the review right there. Ha.

Action Station!

There’s movement at the Clarion Station!

First. This is good for the community.

Second. I’m talking about the news as per a few hours ago. Bob Z has blogged that Clarion 7 will be released (in it’s current, I think, form) to the CSP (Core Subscription) peeps.

This is action. Movement. Even if SV has a long way to go, it doesn’t matter right now. They are delivering to the community. Sure, it’s to a secluded section. Sure, it’s not a gold release. Sure, it might be half-baked.

I care not.

And I imagine there’s more than a few individuals with me.

SV (Soft Velocity) is doing something. It’s public. It’s action. Can I say that any more?

Of course, I’m a hype-monkey. It’s been said before. No denying this. But even people who have far greater clarity and wisdom than me have said that at this stage in the game, action is good. They gain negatively by doing nothing. But now, they are doing something.

And it is good.

‘Nuff Said, more later.

Congrats to the Team at Soft Velocity

from this end of the Community!

Aussie DevCon 2007 .. Part 3 (Saturday Content)

This is definitely spanning more posts than I figured. But then, I wrote more notes than last year. A lot more.

Anyway, we are looking at the Saturday content today, which was the most diverse of the days in terms of speakers and .. content. Ha.

Bob, Bruce, Geoff, Russ .. and myself.

Actually, looking at things, this will be a huge post. Hmmm, it’s a good thing people love reading lots of small fonts and dull language.

You’ll notice that as my talk approaches, the notes become more and more .. less. Ha ha.

Let us gird our loins and rush onwards to the battle! I mean .. to the content!

 

Bob Z .. Clarion 7 – the New RTL, Controls and Menus

 

  • We’re looking at Visual Styles (Tabbed Styles) .. Menu .. etc etc
    • You’re free to change the highlight bar to whatever you want.
    • Simple embed point, take full control .. whatever.
    • Icons in the highlight bar .. make it look a lot better.

 

  • Tools-Options -> Use smart tags
    • Rather than go and access commonly used properties .. have a tag window that when clicked comes up with the Menu Editor, selecting the context’d control you were coming off. 

 

  • XP Themes example
    • Tabs Locations
      • The movement of the tabs .. the text doesn’t get distorted (as opposed to the .NET runtime??)
    • Themed Progress Bar
    • Test List, Drop & Combo
      • Fully themed .. don’t have to do anything to get that.
    • Point of this is that you get all controls fully themed by default, just recompile
    • Now that sheets and tabs are fully themed, the prompts need to be checked transparent if you’re using a non-white??? Theme. Not sure about this.
      • Ohhh, TRANSPARENT controls have a background that is the color of the theme.
      • In Clarion 6 and previous, controls such as prompts were not populated with the transparent attribute, because the background was always
      • The body of the sheet tab will pick up the theme color.
      • If it doesn’t have transparent ticked, then it will have the color of the window assigned to it.
    • The "Type" ing of fonts .. True, Clear, .. the drawing of text in all controls has been replaced, and they will display right, but default.
      • If they didn’t have ClearType in by default, weird stuff (in Vista) would happen.
    • Okay, you set the color of the tab .. and at runtime, the header gets the color .. the actual body stays the same as the theme.
    • 4 different tab styles .. 0 (Default), 2 (Colored), 1 (B & W), 2 (Boxed)
    • The User can change their themes .. not sure, faded out for this bit.
    • Control Collection Editor .. for example, from the Sheet properties, you can click to edit the Collection of Tabs.
    • When you want to highlight certain tabs .. give it a color .. if you want to de-emphasise a tab, give it no color.

 

  • Back to the School App
    • Compiling with both C6 and C7 .. we are looking at the different between the two apps.
    • First try didn’t work .. we got themes in both apps. Obviously Bob is trying to show us that when you compile in other the C7 you don’t get the themed support.
    • Showed that you can Opening Working Folder

 

  • By default, brings in the included DLLs into the directory.

 

  • Showing the compile in Clarion6 didn’t work.

 

  • You can have a separate redirection file for .. each .. Project? App? Not sure which one.
    • No, in the Clarion Version options. So you set it for the version of Clarion you are using.

 

  • Bob talked for a while about the output settings by default .. apparently in the Alpha there was a lot of "discussion" as to where the exe outputted .. in Clarion7 they had just done the bin\\debug or bin\\release .. like most other compilers .. but lots of 3rdParty folk didn’t like it.
    • Possible to continue working when compiling (it’s on a different thread).
    • But not possible to compile a second thing at once .. because MSBuild must compile sequentially.
    • Bob showed us in C6 9056 .. "Extended UI" .. enable the XP Menu, and then choose a color type, which is a theme file?
      • What is the Color Type?
        • The color on the body of the tab (that is, the header)
      • compiling in C6
      • something happened, it could have been something between having C7 and C6 opened at the same time ..???? but Bob’s C6 was very very slow doing any compiling, generating .. the ABC stuff at the start.

 

  • Three things missing from the AppGen
    • File Integration, and the .. missed them.

 

Bruce (Capesoft) .. Making Your Clarion Apps Compatible With And Designed For Windows Vista

 

  • Cover what you need to know, to start thinking about
  • How does Vista impact us as Clarion Programmers?
  • And, How does Vista affect our programs running at our customers ..
    • These are the two questions
  • What’s everyone talking about?
    • UAC
      • Making windows more secure by asking the user to allow programs to do things ..
      • Bruce then showed the Mac ad
      • Showing lots of different windows that UAC pops up
        • You can have 7 dialog boxes pop up (not all UAC)
    • Best way to handle UAC
      • Show a UAC error
      • With a trusty magnum .45
    • Go ahead and try to program with UAC turned on
      • Because the Users will have it turned on
        • This is a myth ..??
        • But go ahead and try.
        • Average time to failure seems to be less than 2 weeks (to try and program with UAC on)
      • The camel may be strong, but the knees are buckling
  • Clarion 6 on Vista
    • Keep it out of the Program Files directory
    • Runs fine even with Aero turned on (minor cosmetic issues)
    • SV blog contains more info
  • Vista for Users
    • UAC will probably be on .. although MS might take a lot of it out.
    • Your program needs to be Vista compatible.
    • Turn on UAC (on a test machine) for testing
  • What NOT to do
    • No INI files in the windows dir
    • Registry
      • only write to HKEY_CURRENT_USER, or better yet, not at all.
        • Registry is not the most reliable of data sources
    • Personal opinion
    • No Data files (including INI files) under the Program Files dir .. use GetFolderPath or ds_GetFolderPath
      • These procs (the api) gets the proper data folders, which have changed from XP to Vista
  • What TO do
    • Sign your apps

 

Geoff Spillane .. SetupBuilder 6 – Vista Ready – A Practical Demonstration

 

  • How SetupBuilder can overcome some of the problems faced with development on Vista
    • but also to show how SetupBuilder can manipulate the files and folders to do some housekeeping, to take some basic tasks, make it very easy to use .. to use the Power of SetupBuilder. It’s main power is in the scripting language. Friedrich has made it so you can dragNdrop .. so you don’t have to learn a new language.

 

  • Code Signing .. Vista’s reaction
    • Showing the UAC window, the first one .. "Cancel or Allow" .. heh heh
    • Audible warning as well that happens (ha ha .. very funny)
    • A Code Signed application is a much more genuine window
      • Different color, different wording .. far less aggressive
    • Signing
      • People hiked their prices up with Vista ..
      • If you have a current sub with Lindersoft for SetupBuilder, then you get a significantly reduced price for a cert. with COMODO.
      • But also, for those who haven’t bought SB .. for $25 (US) you can purchase a Lindersoft Community Membership, which then gives you the reduced price for the COMODO cert.
    • Geoff takes us through the purchasing of a cert. from COMODO through the Lindersoft site.
    • Okay, now he’s going into SB -> the General Information .. and you put in the Digital Signature information
    • It sets up the code signing for the Installer .. but you also need to code sign the Uninstaller? But the Uninstaller doesn’t exist, it’s built at runtime .. so Friedrich did some fancy footwork, and code signs it at runtime.

 

  • Code Signing your applications (as opposed to your Installer)
    • So now we go into the Script Editor in SB
    • Geoff drags the Script Function .. the "Code Sign Application" function .. which brings up a window dialog to fill in the necc. Info.
    • We see SB code signing the application, and then the Installer/Uninstaller after this.

 

  • Embedding your Vista Manifests
    • A quick fix :: (for people with sizable apps)
      • Throw in a Vista manifest, set it to require Administrator
        • You then get the friendly warning .. but you still get a warning, although only once I believe
    • Geoff runs through how to add a Vista Manifest in SB, using the script functions .. dragNdrop, fill in the window .. badabing, badaboom.

 

  • How do we put things in the right place?
    • SB makes it very easy
    • Geoff showed us how
    • Including Registry Entries .. same kind of deal .. fairly easy.

 

  • Handling Shortcuts
    • Very easy interface .. here, as everywhere else, SB explains itself

 

  • If you don’t have a complicated install, you can work with dialog windows, but if you do have a complicated one, well, you lead through and work in the scripting .. very powerful

 

  • Shortcuts again
    • Showing how to add a ‘choice checkbox" for the User to choose whether the icons get installed.
    • seems to be you would discover most of how SB works simply by using it .. seems very straight forward.

 

  • Using SB to do some house keeping
    • Dealing with Files and Folders
      • SB elevates it to Administrator level

 

Russ Eggen .. ABC Compliant Classes (And Templates)

 

  • ABC Standards defined
    • Included in apps when used
    • Must work out of box
    • Allow Developer to make changes
    • Support embeds for public methods
    • Generates correct code, whether embeds or not
    • Allow extending the class
      • Without once touching the base code
    • Classes must be able to be exported when using as DLLs
    • Changing which base class is used
  • Coding the CLASS
    • Russ opened up TextPad ..
    • Created a new Projct in C6
    • Then went back to TextPad
    • Wants to put together a very simple class, to show us a few things
    • So sets up TextPad for the coloring etc of the code

Missed a bit, phonecalls .. went to loo ..etc etc

  • Russ has kept going with the coding of the Class .. it’s Clarion this time .. ahhh, he’s got the .clw open in C7.
  • !ABCIncludeFile(ABC) would link in to all apps whether used or not.
  • Three ! (!!!) changes it to a tooltip in the C7 parsed autocomplete.
  • C7 part
    • Setting the Link Flags is very important .. the source GPF’s without them.
    • Eg. _DEMOLinkMode_
  • Back to the Slideshow
  • Coding the Templates
    • So we have a class in LibSrc
    • Russ then goes into TextPad again, starts coding a simple Template.
      • Reminder to make the Template ABC Compliant .. (the default, if you leave it blank, is Clarion (Legacy)
        • So put FAMILY(‘ABC’) at the end of the #TEMPLATE first line.
      • Need a #PREPARE statement for ABC Compliance .. (Russ also lets us know that his own preference is to code the #ENDPREPARE right now, so as to not forget.
      • Okay, above the #PREPARE there needs to be a #BOXED(‘Default prompts’),AT(0,0),WHERE(%false),HIDE .. and #ENDBOXED
        • This is for setup code going on behind the scenes, and you don’t want the prompts visible
      • This doesn’t yet cause the "Loading ABC Defaults" window .. that’s in the #PREPARE statement (not the #BOXED)
      • Russ then went through the #PREPARE body
        • #CALLs ..
      • The template code to EXPORT all Class stuff (which is a previous point of ABC Compliance)
        • #AT(%BeforeGenerateApplication) .. #ENDAT
    • In the middle:
    • #CALL(%AddCategory(ABC),’DEMO’) this takes ‘DEMO’ and prepends it to the ABC link stuff above
    • #CALL(%SetCategoryLocation(ABC),’DEMO’,DemoClass)
      • That’s all you need to make sure it’s exported for DLLs

Okay. I missed a fair bit of Russ’ stuff, mostly because i was in and out of the loo and on the phone with the wifey, talking about my talk. And honestly, for an hour or two, I was pretty wiped out after the exertion of singing and dancing for the crowd. Heh heh.

Apologies Russ!

However all is not in vein. Ha ha. Or vain.

Dave Beggs came to the rescue. I’ll now display his notes verbatim.

Cheers Beggsy!

 

Included in apps when needed

Work out of box

Allow developer to make changes

Embeds for all public methods

Generates correct code whether embeds used or not

Allows extending the class without touching base class code.

Automatic Exporting of the Class if DLL

Allow changing of the base class used

Coding the class

!ABCIncludefile(ABC) would link in to all apps whether used or not

ShowMessage   Procedure() ! ,Extends            The ! ,extends makes it show up in the embed tree

If you put a comment in a class with three !!! then it becomes the tooltip in the C7 parsed autocomplete

Coding Templates

#Template(Democlass,’Devcon Class’),Family(ABC)   ! the default family is Clarion!

#Extension(DemoClass,’Global Demo’,APPLICATION

#Boxed(‘Default prompts’),at(0,0),where(%false),Hide

  #Insert(%OOPHiddenPrompts(ABC))  !in abboop.tpw – calls group ooppprompts – basically loading all classes in memory

#EndBoxed

#Prepare

   #Call(%readabcfiles(ABC))  ! read the abc header files if not already read

   #Call(%SetClassDefaults(ABC),’DC’,’DC’, ‘Democlass’)   !the second one would have the applicationtemplateinstance in a local class

#EndPrepare

#Atstart

   #Call(%readabcfiles(ABC))  ! read the abc header files if not already read

   #Call(%SetClassDefaults(ABC),’DC’,’DC’, ‘Democlass’)   !the second one would have the applicationtemplateinstance in a local class

    ! this is like an init – set the class defaults   this is ths same as the #preopare – the 2 calls needed at both atstart and prepare

#Endat  !not #Endatstart!

#AT(%BeforeGenerateApplication)  !This will generate the export files for multi dlls

#Call(%AddCategory(ABC),’DEMO’ )  !Demo will be made into _demolinkmode_ and _demodllmode_ – MUST BE UPPERCASE

#Call(%SetCategoryLocation(ABC),’DEMO’,’Democlass’)

#Endat

#tab(‘Global Message Instance’)  ! allows the developer to change the class name

   #Button(‘&Message Stuff’)       ! done on a button so you can use the with, and

#With( %Classitem,’DC’)          ! make the global prompt come up as a single instance

      #insert(%GlobalClassPrompts(ABC))

#EndWith

#Endtab

#Tab(‘demo base class’)     !Allow the developer to change the base class

Prompt(‘&DefaultClass’:’. From(%PClassname)),%Classname,DEFAULT(‘Democlass’),REQ

#EndTab

#At(%GatherObjects)

  #Call(%ReadABCFiles(ABC))

  #Call(%AddObjectList(ABC),’DC’)    !puts a value in %thisobjectname

  #Call(%ObjectList,%ThisObjectName)

  #Set(%ObjectListType,’DemoClass’)

#Endat

#AT(%GlobalDataClasses)

#Call(%SetClassItem(ABC),’DC’)

#Insert(%GenerateClass(ABC),’DC’,’Global Instance’),NoIndent   !Generate the code

#EndAt

#If (%Baseclasstouse())

#Call(%Fixclassname(ABC),%Baseclasstouse())

#For (%pClassMethodPrototype),Where(%MethodEmbedPointValid())

#Call(%SetupMethodCheck(ABC))

#At(%DemoClassMethodCodeSection),Priority(5000),Description(‘ParentCall’),Where(%parentcallvalid()) ! Add Parent call embed code

#Call(%GenerateParentCall)

#Embed(%DemoclassMethodDataSection,’Demo class data section’)

#?Code

#Embed((%DemoclassMethodCodeSection,’Demo class codesection’)

#Call(%GenerateNewLocalMethods(ABC)

#AT(%GobalData)

#At(#ProgramProcedures),Where(%ProgramExtension <> ‘DLL’ or ~%GlobalExternal)

  ! this knows whether to include in multi dll

#Call(%GenerateVirtuals

#group(%Parent Call   ! this is called as a function and retuerns the abc version which could not be done as the template wouldt have recognized abc earlier.

Local templates

Classprompts, not globalclassprompts

Default instancenames setclassdefault in prepare – use activetemplateinstance

Finally Russ has skeleton template.

Also 36 page pdf template

 

Bruce + Jono .. Fun With Capesoft

 

(notes taken from Bruce’s actual words .. I realised too late that I should have been doing this all along, rather than trying too hard to understand and write in my own words .. ha ha)

 

  • takes Jono about an hour and a half to knock the app together

 

  • first group of products
    • Around the concept of LookNFeel
    • We judge things based on what they look like, we shouldn’t, but we do.
    • Most of the car purchase is emotional.
    • Emotional attachment comes with benefits
      • Saving you time
      • Saving money
    • There are a lot of little things that we put together
      • In the app, there’s a very subtle shade of background color
    • Draw heading at the top of the window
      • A 21st century look to it
    • On the Form .. entry fields are rounded
    • If you turn you tabs into a Wizard .. you get a line down the bottom under the buttons
    • Large fonts tends to exaggerate everything, so this looks much better in normal mode
    • You can have icons on your Draw headings
    • AnyFont .. allows you to change your font at runtime.
      • When changing from major versions, we change the font, the style, the heading ..
      • Looks different, works the same (People love this)
      • Changing the CharSet of the fonts .. eg. Greek letters
      • A lot of users who don’t have perfect eyesight anymore, nice not to be looking at a 6 point font.

     

    • TearOff
      • Ken got a standing ovation (phoned up Bruce one day) in the middle of a demonstration .. went to the menu item, clicked .. and got a Toolbar window
      • Put icons, icons in text, dock the window

     

    • Hyperactive
      • Allows you to make meaningful data do things.
      • Internet, Email address, word docs, Skype .. how do we make our users use them?
      • Question about Terminal Services etc .. what Api is being called .. 
        • Bruce said he wasn’t sure, but others said it works fine

     

    • KeepingTabs
      • Remembers which tab you were on
      • Trivial .. but makes a huge difference to Users
      • Can store the info wherever you want

     

    • EasyHelp
      • Who likes writing help? Apart from Russ .. maybe that’s the exception that proves the point!
      • Can write your own help at runtime
      • OR more importantly, someone else can write the help for you at runtime.
      • Capesoft uses their Distributors and Dealers to write their help.
      • Question from Warren .. are there tools available for copying help from other files?
        • A: it’s a Topspeed file, so trivial to do it yourself
      • Automatically populates tips and other things from the Dictionary

 

  • Second Group of products are ones that we have tried to be creative with data .. "Addicted to Browses"
    • Insight Graphing
      • It was really nice to seeing guys adding graphs to applications this week.
      • Lots of different types
      • Do heaps of stuff with them .. right-click copy, add to presentation, drilldowns, send to different places, print .. etc etc.
      • Zoom Out, Zoom In, Copy, Save As ..

     

    • HotDates
      • Calendar view of your data
      • Very illuminating, you can see a lot of things from this that you can’t normally
      • The example of the guy who took a sick day on a Wednesday every 6 weeks, had mapped his entire year out
      • Can go month, year ..
      • DragNDrop the records around
      • Go to the form from any of the records
      • Grab one, move it somewhere
      • You can insert, cutNpaste, copyNpaste ..
      • It’s actually adding the records like a browse

     

    • File Explorer
      • GPS coordinates, plugged into Google Maps .. get the place where they had the sighting
        • "Changing a Sighting record"

     

    • Send To
      • Wonderful story
      • Client is leaning over Bruce’s shoulder, getting the browse right, the sort order .. he said "Great, print that!" .. Bruce said no, we have to go to a report.
      • Which is insane .. so kill two birds with one stone
      • Did a proof of concept, then handed it to someone else to code, which is the better way to code .. get all the glory and don’t do the hard work
      • Send it to printer, file, email, ftp or the clipboard ..
      • And when it’s going there, you can decide the format
      • PDF, HTML, Excel, Word, CSV, XML .. you can add your own format if you like
      • It preserves all the formatting, the colors, the graphics, assuming the destination format supports those elements.
      • If your browse is really wide, when it goes to the printer .. prints over multiple pages .. multiple columns of pages .. there was a Sideways reference here, from old Apple days
      • Q: will this work with Clarion .NET
      • A: no idea yet, don’t have it
      • Q: do you have to have Office installed?
      • A: if Excel doesn’t exist, it will be greyed out on the window, gracefully
      • Q: if you don’t want Excel, do you need Office Inside?
      • A: yes you do.

     

    • Office Inside
      • Office Inside does have a nice feature, if the user gives you a file in excel format .. the Import of an Excel file straight into a TPS or whatever file you have
      • Through a wizard interface
      • You can do it one off, or leave the wizard interface for the User to use
      • Bruce’s First Law .. People Lie
      • Bruce’s Second Law (which has been repealed) .. Never Call the Customer a Liar to their face
      • Bruce’s Postal Law .. the further away things are, the faster they get to the destination

     

    • GPF Now
      • I made a comment this week, and people laughed
        • "GPF’s are your friend"
      • But I was serious
        • They are a very important programming tool
        • What is wrong .. and Where it’s wrong
        • What is the biggest problem?
          • We don’t know how to interpret the information
      • "Would you like to GPF?"
        • For the masses (because real programmers code in HEX) we wrote a little app
          • A whole pile of information in the window that comes up after pressing "GPF Now" ..
      • What build of windows
      • What key was pressed
      • What thread was running
      • The line number of the program
      • The procedure, the module
      • All of the line numbers that were used on the way to this line

     

    • NetTalk WebServer
      • The Online Account app on the web
      • A simple clarion exe, no dependencies, no IIS, no Apache
      • Accessible via any browser
      • There’s a danger here, with all these examples
        • You think this is the way this has to look, and get set in the pattern
        • You have complete control as a programmer over what the thing looks like
      • Jono clicks through Invoices, line items, Customers .. showing off various aspects of the Web Serving.
      • Customers->Change button-> a dropdown for Country
        • The Shipper Codes change with the change of DropDown
      • Customers->Invoices Tab->
      • In Jo-Burg, people deployed on Monday the week after the Capesoft Training
      • Online Calculator example
        • BMI Calculator
        • Don’t need a button, because all the fields are dynamic .. but you can if you’d like
        • All of this is done with Clarion code, no custom Javascript in this particular app
        • Q: ????
        • A: we are not taking an existing application and transferring it to the web server
      • What we’ve got are browses and forms for you to create (you can reuse your reports)

     

    • RightReports
      • Spend a few minutes with a brand new product
      • Available in alpha (we have a closed alpha group)
      • RightReports is the ability to include in your own application (all source code, no dlls)
      • The main reason why we went down this road is that you have the ability to write your own code, your own functions that the report engine will make use of
      • Went to the loo
      • A very simple report, Invoice
      • Q: Dropping in Graphs
      • A: hopefully one day