TNotebook or TPageControl - delphi

I have an application using TNotebook to switch between different sub pages, that are shown.
Now I have to extend this code a little bit (namely add a page and change sizes).
I was told that TNotebook shouldn't be used anymore. In Delphi's help I find "New applications should use TPageControl".
My question: Should I refactor the code to use TPageControl instead of TNotebook? What are the disadvandtages of TNotebook?

The main advantage of TPageControl, in my opinion, is that it is a system native control, unlike TNotebook. When you use system native controls, the control is painted by the system, and so takes on the look and appearance that is native to the operating system that you use.
When the application is run on a new version of the OS, your control automatically gets the appearance that is native to that OS. What's more, the behaviour is system native. By that I mean the way the control responds to keyboard input and so on. That's less of an issue with TPageControl since the system does not provide that much default behaviour. But as a general rule the advice is sound.
When none of the system native controls meet your specific requirements, you may need to use a non-native control. And then you have to work to make sure that your control adapts to its surroundings. But when there is a system native control, unless there is a strong reason to avoid it, you should use it.

Another disadvantage of TNotebook is that it excludes the form or frame on which it is placed from inheritance.

Related

Binding a trackball to NPAPI

I want to use a second pointing device (the trackball) as a control for a specific function on a program. This means I would NOT want any mouse functionality from the trackball, I just want to get the movement data and somehow use the NPAPI to get that into our web app. Is there a way to bind a mouse/trackball to a specific program that it doesn't act as a mouse/trackball for the computer?
Thanks in advance!
UPDATED: actually ask a question
To the best of my knowledge and my understanding of how HID devices work, there is no way to do what you want to do. If you could do it at all, you could probably do it from an NPAPI plugin, but there is no way to tell the operating system not to take control of one specific pointing device as opposed to any others.
Now, if you had a special HID trackball that didn't show up as being a regular pointing device then you could possibly do it with that, but I have never heard of any way to take control of just one of potentially many HID pointing devices on windows, linux, or mac.
There may be a way to hack something together in Linux by changing the way the drivers work, etc, but I don't know of any.

What Actionscript features do not work on iOS?

There seems to be a lot of conflicting information out there. It might be that support has increased recently, or changes to adobe.com/air have made some information difficult to find - but I can't track down a definitive list of things to avoid.
I know that actionscript won't run in loaded SWFs, I know that some people say that filters and blendmodes and halo components won't work. I've also read many posts saying they will (at least that blendmodes will, and that halo will run, but slowly so still use spark)
I have a large amount of AS3 code to plan for upgrading to work on iOS, but at the moment I have no idea what things will break (or what things will break when those things have been fixed!)
Is there a list of unsupported APIs, or iOS dos and don'ts?
Thanks
:S
First, yes. Externally loaded SWF's will not run. You can however embed SWF's/SWC's into your project and include them inside of your package.
As far as Flex components, stay away from Halo. You should use Flex 4.6 and stick to components with mobile skins. I recommend downloading Tour de Flex http://www.adobe.com/devnet/flex/tourdeflex.html to get an idea of whats available.
As far as blend modes go, I'm not really sure. I haven't used them in mobile yet. However filters are supported but they are expensive. For drop shadows on rectangles there is something called RectangularDropShadow. This is actually a component and therefor less expensive. However it can only be used on rectangular groups.
You should have access all of the AIR API's. You will however be restricted when using some of File related classes since I don't believe you can leave your Appliaction Storage Directory.
One big performance tip I can give is to use AS3 over MXML whenever possible, ESPECIALLY when creating item renderers. Use BitmapImage over Image whenever possible, again especially in item renderers. Use cacheAsBitmap whenever you have images that don't change often. And stay away from any Flex component that doesn't have a mobile skin.
You may also want to read up on View and destruction policies.
http://www.adobe.com/devnet/flex/articles/flex-mobile-development-tips-tricks-pt1.html
This link also has some more performance tips
http://www.adobe.com/devnet/flex/articles/flex-mobile-performance-checklist.html

Delphi Web Development - using TWinControl to draw objects

I want to develop a Web application in Delphi using VCL. I tried UniGUI, but it does not seem to work. Well, it works, but quite not how I wanted. Let me explain.
My problem is that I do want a library whose visual controls expose Handle to them. UniGUI does that, but it's not working correctly - for example, the main form has a Handle set to 0, but a TUniPanel has a different handle and what's more - it's always the same, even if I run the app in another window or tab.
I want to have a control which exposes its Handle correctly, because I need it for the purposes of the application I want to develop.
Do you know any other VCL library which allows me to do that? I tried Intraweb, but it does not seem to solve my problem either.
The only way I know that a web browser could host VCL code would be through an ActiveX. I wouldn't really advise you to take that approach.

How best to create a HMI display panel (user-customised interface) in Delphi

I need to improve a screen in our Application that presents an HMI (Human Machine Interface) display embedded in our Delphi code. This screen provides our customer with the ability to perform a range of actions (run test, product report etc) and to expose and view key named data values. This customisation is required because our Application controls machinery that might be operated by a range of skill levels from simple operator (may not speak English and must have very limited control) through to a power user who wishes to 'see everything' and have max control.
Some years back I created a solution based on an embedded HTML viewer (Turbopower's as it was then) and TPageProducer to dynamically tweak an HTML template (that the user could customise) and which would display a simple set of controls and data tables. This works fine but is slow to edit (you have to tweak the template and look-see the effect) and I'm sure there are better ways now.
What I need is similiar to a Delphi form that can be customised at runtime. I need: buttons, labels and edits. Editable shapes and arrows are desireable as are fixed images over which controls and text can be laid. The layout should be saveable (like a DFM file) and text labels should be of two types - fixed text and those which update to display key values on an update notification (like a DB control would). The final layout should zoom its scale to fit a resizable layout.
This question is about the best tool for the job and I'm not coming into this totally cold, I've experimented with Greatis Form Designer and obtained a working solution but before I commit, I would apprecaite comments about whether a report tool (with built-in report editor) would be possible / useable / better since a print dump feature would also be useful. (Fast Reports? Quick Report etc?). Note though that this is a display requirement primarily. Comments re newer embedded HTML solutions would also be welcome as would anything to ensure max future-proofing of the layout format.
Any solution should be useable in Dephi 7 (for now!) and does not need to be unicode as long as there is a migration path to this for newer Delphi's.
Any other comments or observations would be very welcome. Thanks.
Have you looked first at the free JVCL stuff? There's a JvInspector (RTTI component property inspector, just like Delphi property inspector), and a form designer, and so on. You could roll your own solution based on these, and even use JvInterpreter for some scripting capability.
Secondly, if you can support ANY control that you have, in your designer, and you need some HMI specific stuff, check out IOCOMP: http://www.iocomp.com/
TMS Scripter Studio Pro provides a Delphi-like IDE and form designer with scripting, but it maybe overkill for your requirements.

Tabbed document interface in Delphi

I'm considering different user interface layouts for my next project and I was wondering if there are either integrated or 3rd party frameworks which allow me to create tabbed document interface?
To clarify, what I want is not some kind of docking mechanism or either an MDI interface but primarily a framework which allows me to have one main form and one or more secondary forms which will be shown as tabs inside the main form.
Though I said I don't want any kind of docking mechanism, I made a small test application that actually uses it. The result I got is very close to what I want. First, I miss some features like the close button on each tab. Second, I'd have to create some kind of framework of my own in order to automate all tasks, like creating and destroying the tabs, associating each new form with its tab, freeing the form when the associated tab is closed and so on. I'm not saying I can't do it but I'd like to know if there are any ready-made frameworks which already have all these features. Though I'd prefer an open source solution, a commercial one is also welcome.
Third-party components are not mandatory here.
You can use standard Delphi controls to obtain what you want:
Put a TPageControl on your form (from Win32 tab);
Set its Align property to alClient;
Right click on the control, then select "New page" to add a new page.
Then don't write your "tabbed" interface on forms, but on frames.
You can also create pages by code, displaying the frame inside each page.
I don't think there is any framework for tabbed interface, but for nice looking tab/page controls with close buttons on each tab, please check the following:
rkSmartTabs, it simulates Google Chrome browser's tabbed UI. and it's open source.
TAdvOfficePager, MS Office style.
Hope it helps.
I recommend using a tool bar(TToolBar or any similar) and frames(TFrame) in order to mimic tabbed interface, reason?! well Delphi is going cross platform(no secret in that) they will port most if not all of the standard VCL shipped with Delphi, so WHY NOT use this as an advantage?
Just create the frame(dynamically) when the user clicks on a button from tool bar and destroy the previous one(if exists) so you will keep memory usage at minimum, application startup/shutdown time will be very good, on the other hand, if you chose to use (cx)TPageControl, TAdvPager, etc. you might get caught in a situation in which one form(the main I suspect) will have so many VCL's that it will take a lot of UNNECESSARY memory and it will be slow.
Using frames has a lot of advantages, if somewhere in your application you need a "tab" to be shown, you can simply create the needed frame dynamically and use it without additional work.
Anyways, this is my two cents, hope this helps.
I recommend TvjPageList, which is part of the JVCL suite of components. It's open source and seems to fit your requirements.
I use JVCL JvDocking, and its tabbed docking system, to make MDI-like applications.
You can also float, or tile your windows, in addition to having them in tabs.

Resources