Delphi 7 - Embedded file open dialog in a form - delphi

Does anyone know if it is possible to embed a file open dialog inside your own form?
We have a tabbed dialog and on one of the tabs we want the user to be able to browse for a file with the same functionality as the the standard open dialog e.g. 'Look in' combobox, places bar, shell file list, file name comboedit with name completion etc etc.
I've looked at recreating the dialog with some 3rd party components, namely Jam Shell Browser Components
I can get most of the functionality this way, but I'm missing a couple of things e.g. the places bar and the filename auto completion\suggestion

I don't want to say it's impossible but considering the amount of ugly winapi hacks you'd probably involve I suggest "recreating the dialog with some 3rd party components" but with VirtualShellTools.
VirtualShellTools can be downloaded from this SVN archive.
And here's the google code project page.
(At least it has the filename autocompletion combobox though i am not sure if it has the places bar). Hope it helps.

The places bar is not that difficult to implement using a TListView component set to large icons. The Raize Components library also has some source that would help in this arena.

Just a small note, it's fairly easy to add an auto-completing combobox with SHAutoComplete.
See this article for details.

Maybe this Shell Controls Demo can help you.
Edit: ATM the site seems to be down. The Wayback Machine helps.
Here's the latest download link for the controls involved from the wayback machine:

I would re-create it: it shouldn't take long with the VCL Components. The autocomplete is not hard, and you can get the rest of the data if you look through the windows docs long enough.
You can try and cheat by detecting the tab change and displaying the open dialog as if it were the tab page. You will have to detect the user clicking outside of the dialog (e.g. on a different tab) and prevent it closing until you want to change tabs.
Cheers

Related

execute swf in delphi7

I am trying to create something like a "preloader" in Delphi 7: when the user loads a file or executes a procedure that takes a while, I want to have an indicator that shows him that the procedure is working but he has to wait a bit.
I have in mind a loading bar or a spinning circle, if necessary without showing the percentage that has been loaded or the remaining percentage.
I created a spinning circle in flash but I can't find a way to use in Delphi 7.
I tried to call my swf "preloader" through an Animate Control but failed because it is only compatible with avi files.
I also downloaded a free spinning circle in .gif and tried to add it to my Delphi project in an Image Control but this also failed, because the image isn't compatible with gif format.
Is there any way to create this knd of "preloader" in Delphi or add one through an external swf or gif resource file ? How can this be implemented?
I use Flash Engine from Eugene Kryukov, but it is not on sale now.
Another solution would be to use Embedded Web Browser - EmbeddedWB, wich has support of swf from the box.
I have tried it right now, it works. But you'll have to have Internet explorer installed. The sample of usage: place the component on form and do this:
EmbeddedWB1.Navigate('C:\test.swf');
Another solution - you know, install component ActiveX:
1) Install flash
2) from delphi menu→Component→Import ActiveX Control
3) finsd in a list and select "Shockwave flash...", press "install" button
4) after it you'll see on the tab "ActiveX" the component ShackwaveFlash
5) in object inspector put the path and filename into "ShockwaveFlash1.Movie" property,
set ShockwaveFlash1.Loop and ShockwaveFlash1.Playing в true.
6) compile, run and enjoy.
After searching internet forums for many days I found the following solution.
First you have to have already installed Flash player (not the Flash web-designer of the Adobe suite).
If not then close Delphi and visit the Adobe's website. From there you should download the appropriate flash player according to your OS. After you have installed or if you already have installed Flash player then follow the below procedure:
Open Delphi and go to menu→Component→Import ActiveX Control. You will see a dialog box. Inside
this dialog box you will see a list of components. From this list search and find the
"Shockwave flash" component. Check it and press install. Then Delphi will ask you some questions
which you don't have to spend time, just press the "ok" button.
After finishing with the 3-4 dialog boxes, Delphi will eventually add a new component to the
"ActiveX" tab. Open Delphi and choose the "ActiveX" tab, you will see the "ShockwaveFlash"
component as the last control of this tab.
In order to use it Select this control and put it in a form. Give the appropriate dimensions
and the path and filename of the .swf (or .flv) file you want to play.
Set properties "play", "loop" to true if you want to make it play continuously or put "loop" to
false in order to make it play just once.
Be aware: Not all properties of the control work as they should. If for example you want through code your file to be visible or to hide at your will (e.g. on the press event of a button) then you will find out that the control does not follow your orders.

Turn off context menu for Component applied by CnPack (design time)

After I installed cnPack, right clicking on a component in my form seems to have taken away any specific items that the component itself may have applied.
eg, right clicking on any Dev Express component will usually bring up version details. Now I get a bunch of other context menu items and the Dev Express ones have disappeared.
Is there a wizard or some other option I can disable to stop this? I can't find one anywhere.
Thanks
EDIT
Restarting Delphi fixed it in the short term - but has come back again so I'd still like to find a resolution to this....
Right-click menus are controlled by component editors, and AFAIK there can only be one component editor registered to a particular class type at a time. If CnPack's design-time package is loaded after DevExpress's design-time package, then CnPack's component editor will be the last one registered and take priority.

Delphi Custom Listview Draw

I am looking to make something like IPhone Listbox !
I found someone who provided a download url for this project: but I was to late and the download url does not work anymore.
So I'm asking if killercode the same member on experts-exchange to upload it again if possible and if there is someone who can help me find the right component for this kind of listbox to use in Delphi.
TDbCtrlGrid looks a lot like what you are looking for.
You just define how each row has to look in the form designer, and that is used as some sort of template for each record in your dataset. It shouldn't take more than a couple of minutes to reproduce whatever you have in your screenshot.
This screenshot was found via google and shamelessly posted here..
Also, check this question:
Delphi control that could mimic "Add-ons|Extension list" of Firefox?
It's about somebody trying to mimic the FireFox add-on list:
If you want to pay for components, TMS software do an iPhone controls pack, which i think has a listview.

How do I add recent items to my program's jump list on the Windows 7 taskbar?

I'm using Delphi XE and would like to add "recent items" in the Windows 7 taskbar jump list for my application, like when right-clicking on Microsoft Word brings up recently opened documents.
I've found information on how to set the progress but nothing on jump-list items. Any help would be greatly appreciated.
This will happen automatically if, for instance, you only use the standard Windows file dialogs. At least my text editor, Rejbrand Text Editor, has got such a MRU list by Windows. It lists all files I have recently edited using Rejbrand Text Editor, even though I have not written any code at all for it.
I think that Windows observes the files you
open and save in your application by means of standard Windows file dialogs
open in your application by starting yourapp.exe <file name>, for instance by double-clicking a file that opens in your application
and automatically display these in the list.
If you want to control the task bar button and menu programmatically, you can use the Windows API. Delphi-specific examples are found in this blog post.
In my opinion the best way to do this is to make the following simple API call:
SHAddToRecentDocs(SHARD_PATH, PChar(FileName));
This not only deals with Windows 7 jump lists but also adds your file into the system's list of recently used documents which has an effect on early versions of Windows too.
Call the function whenever you open or save a file.
For your convenience, a link to the documentation of SHAddToRecentDocs().
Here are some resources that I have found useful when making my programs vista ready
http://code.google.com/p/theunknownones/wiki/TaskbarListComponents
http://www.installationexcellence.com/articles/VistaWithDelphi/Index.html
http://www.theabsolute.net/sware/delphivista.html

ASP.Net MVC Go To Declaration On view

Is there anyway when in an MVC view to right click a function call and get to the declaration? Like you can do in the code behind/controllers
with resharper: control click on it.
Double-click to select, global find (button near the search box at the top), and then you usually have only couple of search results so you can easily see the function. If it's not in your code but in some lib, then I think you'll have to copy it, open Object Explorer, and search for it. With keyboard shortcuts not so bad; or you can write a VS macro to do it ;-)
But there's even easier way - copy, Alt-Tab to FireFox, and google for it ;-)

Resources