Sunday, October 6, 2013

A Solution for FMX Paint Issues

Rambling

After hitting a wall with the same project rambled about before while adding another interface for lab workers (essentially enlarged input areas which could be seen from afar and entered into through speech), I made it my mission to find a solution for it. Without much effort (lucky!), I got to a question which is slightly related and gives a solution to the problem. Including that, I have successfully eliminated any Process* methods from my code. Some places still remain problematic but repeated repaints do the job - All areas are now working flawlessly!

Link

Here check it out: http://stackoverflow.com/a/8424750/1388291

Monday, September 30, 2013

Rambling: The FMX Control Repaint Menace

Well I have been developing data management apps for businesses and the government in FMX and yes, the apps need more time to mature vs VCL. But I have come to understand that the customization power of FMX is unmatched and providing my clientele their wished features, useful and ridiculous alike, is easier in it instead.

Now to the topic, the most frustrating issue in the FMX framework is the repainting / updating / invalidating etc of a control and honestly the only one which hinders me. I have dealt with or worked around all others. I never use Application.ProcessMessages, it is a horror, best left alone. I normally end up using in combination all the available methods or if nothing comes to fruition, exposing the hidden ones through hack classes, or rewriting the controls if all results in vain.

I haven't tried or explored any WinAPI based solutions, I am kinda afraid of them, the methods and their arguments make me dizzy (who the hell designed them, what were they thinking! And I just get lost in it...).

I remember last month I was developing my largest DMS spanning multiple labs and their controlling govt authority, and when I was ready to give it its first release status, I included an additional progress bar for smaller transactions with the remote databases. The first run, and a bomb exploded in my head, nothing was showing up, no grids, buttons, nothing on the parent layout of the progress bar. I reverted back through the SVN but the same result. Anyways after 4 days and a question on stackoverflow to no gain, I randomly started putting in methods that may even be remotely connected, and I found an unreliable solution, but a solution which was SetFocus! -_- After fiddling with may combinations that I was able to get all the controls displayed correctly. Like handling the grids first, then the progress bar and lastly the buttons.


Well here is a recent post about this issue at Delphi-Haven which is much better if one wants to get an in depth understanding of the matter. Also it has a solution for updating the controls by updating the whole form using WinAPI:
FMX Issue: Inability to safely process paint messages immediately

That solution works for me for less congested forms but doesn't for otherwise as I usually work with layers and a single main form to accommodate all interface jobs.

Thursday, September 5, 2013

UPnP Code for Windows XP, 7 and possibly 8 - Part 1

Well getting to this one and making a component was really tough and after too much frustration that I got to know about the dependency of provided WinAPI methods on the version of the windows. I am putting the simplified version here so no other gets to be the one stuck...

Oh I also found out that there is a code independent of platform embedded in libjingle somewhere, will investigate in the coming days.

Rambling; Why Blogspot, why? Why don't you have tab functionality here and an option for indenting would have done wonders to the readability of my codes...


Tuesday, July 30, 2013

Kick Off, StringToCaseSelect & FindTimeDifference

Hi,

My first blog for Delphi Firemonkey Programming. It has been an year for me while producing FMX based apps so thought why not share the shareable part of my code for free and improve some snippets with your valuable input.

One reason being to piss the proprietary IP centric devs around and the other to help devs like me struggling with the framework and getting yelled at by our bosses in the process. :)

I am kinda low level programming freak so my methods may have seemingly unnecessary differences with anybody else code because I try to save as much CPU time as possible. I made a proprietary OS for Atmel Microcontrolelrs back in my university days, so the habits of nit picking tiniest bits of CPU cycle wastage kinda stuck. So if you all can suggest some tweaks, I will really appreciate it!