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.
Related
When I press ctrl+shift+B.
In Delphi XE7 (with CN_Pack installed) I see the following:
When I press ctrl+shift+B again the >^ disappears.
What does this mean?
According to the Delphi documentation:
ctrl+shift+B Displays the buffer list.
This is something else though, what is it?
From your screenshot i see that you have installed the "Bookmarks" plugin also. This plugin registeres this shortcut to set a temporary "caret marker"
From their website:
Sometimes you don’t want a permanent marker; you just want a way to quickly navigate back to where you were. Press Ctrl+Shift+B to drop a temporary caret bookmark, and press Escape to jump back to it.
See: https://parnassus.co/delphi-tools/bookmarks/
The default behaviour of ctrl + shift + B is to show the list of edit buffers being maintained by the IDE. Roughly speaking, this corresponds to files open in the editor, but also may refer to files opened by the IDE but not currently open in a visual editor.
For example, after opening one of my scratch test projects, the IDE opens the main form file but also the project DPR. Only the main form source is initially loaded into an editor window, but the IDE is maintaining an edit buffer for the DPR 'behind the scenes'.
So my editor has a tab for fMain, but ctrl + shift + B presents a dialog listing both this file and the DPR:
If ctrl + shift + B is doing anything else in your IDE then either you or some package installed in your IDE have re-assigned the shortcut, in which case the Delphi documentation and standard behaviour obviously does not apply (or there is a bug in your particular Delphi IDE).
I am using RAD Studio xe6 and I have a simple Firemonkey form, what I want to do is get all Images that are in a folder and display them in a list for the user to see, is this possible, and if yes how.
Delphi already ships with a sample program which does similar thing that you seek. The sample program is called FireFlow. If you haven't installed sample programs while installing Delphi you can get the sample program from:
http://docwiki.embarcadero.com/CodeExamples/XE6/en/FMX.FireFlow_Sample
But othervise what you want to do is first search the specific directory for supported image files. To do this use FindFirst, FindNext.
Then you need to decide how are you going to display these images. Now if you intend to display them inside the listbox controll do check the CustomListBox sample which you can also get from web here:
http://docwiki.embarcadero.com/CodeExamples/XE6/en/FMX.CustomListBox_Sample
I try to have a similar layout during editing as well debugging. When running the program my structure and object inspector disappear. I did create my own desktop speedsetting, set the debug desktop to it as well, but as soon as the program runs structure and obejct inspector disappear. How can I prevent that?
A question related to this: the edit menu changes as well. A right click on a procedure name results in a popup menu with the first item being "find declaration". When debugging the first item is "close page". I find the find declaration item a fast way to find some code. Apart from that it is frustrating to lose one's code because you click "no" on the question to save the information (I know, it's my fault but menu's shouldn't change in my opinion).
Thanks,
Arnold
What version of Delphi? Dialogs and menus change between versions (and even between SKUs of the same version).
For the first, open Tools->Options->Environment Options and uncheck Hide designers on run in the Running group box (D2010, XE, and XE2), or Tools->Options->Environment Options and unchecking Hide designers on run in the Compiling and Running group box (D2007).
For the second: The right-click menu is called a context menu, meaning it displays what is appropriate in the context of when it's being shown. It's entirely appropriate for it to change depending on when and how you're using it; that's the way it's supposed to work.
Right-clicking on a .zip file in Windows Explorer is different than right-clicking on a Word .doc file, because they have different options based on context - a zip file has an 'Extract to...' option that the Word document doesn't have, because 'extracting' a Word document doesn't apply. Same applies to right-clicking a .exe file, which has the Run as Administrator option (Win7), as opposed to right-clicking a .pas file, which doesn't offer that option.
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
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