Behavior in Delphi Documentation Viewer - delphi

Delphi XE2 Update 4 Hotfix 1 and Help Update 6 for XE2.
If I am in the IDE, highlight an object name such as TLabel, then hit F1, I am transported to the description of Vcl.StdCtrls.TLabel in Delphi's help application. The page gives me information for both the Delphi and C++, but I can click on Display Preferences in the top right and 'un-tick' C++ so only the Delphi information is displayed. But now, if I click on TEdit (either by clicking within the help page under See Also or by selecting and F1-ing in the IDE), the Display Preferences automagically reverts to both Delphi and C++ when the TEdit Help is displayed.
If, on the other hand, I go directly to embarcadero online help, for example: http://docwiki.embarcadero.com/Libraries/XE2/en/Vcl.StdCtrls.TLabel to get the same information (using Chrome), the browser (?) remembers my Display Preferences and, once I have un-clicked C++, will only show me the Delphi information if I click on TEdit or further pages.
This drives me to distraction, as I am not the least interested in C++. Have I missed some option within XE2 to only select Delphi in Help's Display Preferences, or is this a 'feature'.

I don't think there's anything you can do with XE2's docs to fix this.
This was improved on in XE3's documentation, and improved even further in XE4's and since there have been four versions released since XE2 there won't be any further updates to it.
(You can't compare the online documentation with the local disk documentation; the first uses the functionality of the web browser, while the second uses the functionality in the MS documentation viewer, which happens to contain a web browser control but implements the functionality in the app itself instead.)
Answer by Ken White

Related

Form/Button/other component styles

Ok, so I downloaded a .zip file of all different kinds of examples from embarcadero... the way the buttons look and among other things are completely different from when I just create an application within my Delphi 7. I believe these examples were made for or made at a new time... because the button look way different from the way the button when I put them on my application. the buttons from the example look very modern and sleek and have mouse over effects (This applies for all the examples..its not a custom component ) I was wondering I can get this effect in my own applications within Delphi 7.. I can do this by opening one of the examples and just erasing all the code... but that's not what im trying to do..im wondering how I can accomplish these styles.. how come the examples have these nice looking buttons and such..but when I make an app within D7 its much older looking and such..
I apologize if my question is hard to understand.. and I appreciate any help on this.
Thank you in advance.. I appreciate it.
If I understand your question correctly, you're asking about the native control appearance changes that were added by the addition of Windows Themes in Windows XP.
Delphi 7 supported themes by use of the XPManifest component, which does nothing but add a manifest to your application which tells Windows your app is theme-aware and therefore it should load a more recent version of the common controls library. You can find the XPManifest component in the VCL component palette on the Win32 tab, or simply add the XPMan.pas unit to your uses clause. Note that the themed drawing does not work for all controls (grids, for instance, are not drawn using themes, and IIRC neither is TSpeedButton - it's been a long time since I used D7, so I'm not sure exactly what is and isn't supported, but the support is limited).
Starting with Delphi 2007, there is built-in support for Windows Themes, which is available by default in new projects. It can also be enabled in older projects using a checkbox in the Project->Options->Application dialog.
(Of course the real answer is that if you want your app to have the features included in modern versions of Windows, you should upgrade from your Windows-95 era version of Delphi to one that is more recent.)

How do I get TWebBrowser in Delphi XE2 to run?

The TWebBrowser component in Delphi XE2 seems to be seriously buggy. Is there some sort of code I have to run in order to instantiate it in some special way?
Create new Delphi project
Drop a TWebBrowser component onto the form.
In Form1.FormCreate() call WebBrowser1.GoHome (to google).
If I compile this 32-bit and go to some specific webpages I get error messages.
google (ncbi nucleotide blast) and click the first link.
In addition to these javascript errors if I click a link which usually opens in a new window, it opens in IE (a separate application).
The 64-bit version seems even more broken. By going to that same site (ncbi nucleotide blast) I get the entire program crashing due to a 'divide_by_zero' error.
Regarding the floating point exceptions, TWebBrowser expects to operate with floating point exceptions masked. It looks like you are using Delphi default floating point settings and have exceptions unmasked. I suspect that if you mask exceptions then your problems will disappear.
Do that like so:
SetExceptionMask(exAllArithmeticExceptions);
And as others have said, you silence the Javascript popups by setting Silent to True.

How to intermix Windows dialogs and VCL forms?

I want to interoperate with third-party application and to provide a dialog box to it. API wants standard DialogProc and DLGTEMPLATE pointers. However, i'd really like to take advantages of VCL, form designer and such. How can i do this? Which code samples i can study?
Technical:
How can i do:
embed VCL form (or frame) into dialog box created from some boilerplate DLGTEMPLATE i supplied.
connect VCL WndProc to windows DialogProc.
Delphi VCL does not interoperate with standard windows Dialogs designed with dialog resource types. Visual studio supports creating dialog resources, still, even in VS 2010, but Delphi never has. Whatever it is that you've got an API for, please mention exactly what it is, and this will (if it isn't some obscure or in-house thing) increase the odds that someone can help you. Since the API expects a dialog handle, and expects to show that dialog and then run your dialog procedure, and send you stuff, you have two choices:
Don't use delphi at all. Use visual studio 6, because that's about the era that this API must have been designed for.
Use delphi, but use a third party dialog designer from Visual Studio 6 or Borland C++ 4.5, or so, we're talking about 1996 era here, and then write your DialogProc without benefit of any VCL controls or vcl code whatsoever.
I have never ever heard of anybody daft enough to rely on windows dialog resources to build their plugin-screens-in-a-dll-via-an-API. I'd really like to know what app it is you're trying to extend.
You might be able to add a modal dialog box that you show modally, from your code, and such a modally shown sub-dialog (a second level dialog) could use the VCL, but the top level dialog is not even under your control.

WM_Copy, wm_gettext and wm_keydown fail?

The problem: I need to obtain the selected text from a window in a Windows application (not my program). I am doing my work in Delphi XE and the software I am attempting to access is a kluge built over the past 15 years with C, C++, VB and who knows what else. I do not have the source code. The edit box (an RTF memo) I am attempting to read is of the class "Ter32Class". When I use wm_copy, nothing goes to the clipboard. when I use wm_gettext, nothing. When I use wm_keydown commands (to simulate Ctrl-Ins or Ctrl-C) nothing happens. Note that I can get all of these alternatives to work in wordpad, notepad, and FireFox but not this application (or OpenOffice, incidentally, but that's not the issue). The only way I have been able to programmatically obtain text from this box is to use autohotkey with the simple "send ^c" command. While it works, it is inelegant. HELP?!?
More information: Window hierarchy: Ter32Class is a child of OI_Mdi which is a child of MDIClient, which is a child of OI_Window . I am drilling down to obtain the appropriate handle as it will respond to a paste command.
I am using Delphi XE but I'd love any solution in C++ or VB if no Delphi XE gurus have the answer.
From Quick Macros Forum
One of the windows I need to talk to is of class Ter32Class which
apparently is a TE Edit Control, an editor that doesn't inherit from
the standard RichText Control
and
The published method of talking to this control is via it's DLL
so unless something has changed (post is 2006), it appears you'll need to use it's dll to get the text.
From Sub Systems (TE Edit control website)
Application Interface functions
GetTerBuffer: Retrieve Window Text
HANDLE GetTerBuffer(hWnd, size)

How to implement this type of Docking?

Take a look at this Open Source Application called Construct
.
It uses Panel Docking where you can drag a Panel, and then some on screen visual aids to show where the Panel may be docked, as seen below:
Before Dragging/Docking
During Dragging/Docking stage
When dragging/moving one of the Dock Panels the Window now looks like this:
As you can see, when dragging/moving the Object Panel it displays the visual aids of where the Panel can be docked. It also moves around like a free Window when not in a docking position. The same applies when dragging/moving other Dock Panels such as the Project Panel in this example.
This is an example of an Application using this, I have also seen other Applications employ this too.
Is there a Delphi way of acheiving this behaviour?
I have some panels that take up some space, freely moving or docking them would be useful feature to implement.
Thanks.
UPDATE
It seems the LMD Components offer such a component which I may look into.
See this old question for docking library.
Recommendations for a docking library for Delphi / C++Builder?
Why there shouldn't be a way of achiving this in Delphi?
I don't know if there are free components around but DevExpress offers a library for it and other vedors for sure have such libraries in there portfolio too.
If you're interested in coding such a thing your self, you might take a look at Dockpanel Suite it is written in C# but the WinAPI fundementals behind it are the same.
Addition:
does anyone know of good delphi docking components?
There's a new release of the DevExpress docking components coming soon. It includes the Visual Studio style docking that you show in your image.
See this link for more information: http://community.devexpress.com/blogs/ctodx/archive/2011/04/26/sneak-peek-visual-studio-dock-style-for-vcl-docking-library-coming-in-v2011-1.aspx
Delphi supports this out of the box. There's a limited demo (meaning they didn't demonstrate all of the functionality) in the Samples (Demos) folder, depending on which version of Delphi you're using. In Delph7, for instance, it's in $(DELPHI)\Demos\Docking, and in D2007 and up you'll find it in C:\Documents and Settings\All Users\Documents\RAD Studio\x.0\Demos\DelphiWin32\VCLWin32, where x.0 refers to the Delphi version. The locations for D2009 and XE will vary if you've installed on Vista or Win7, but I'll trust you can track them down; if you can't, use the Start Menu's Embarcadero RAD Studio <version>, and choose Samples.
There's also the TDockTabSet component included in later versions of Delphi, and you can find an article and code at Embarcadero Developer Network explaining and demonstrating it's use. (TDockTabSet is pretty much what's used in the IDE for docking now, I believe.)
I did a few intro videos on dockable forms in Delphi, there are available here and here. They're also on YouTube - Part 1, and Part 2. They are pretty introductory however.

Resources