I am Using Delphi VCL and the problem is that I am creating labels and printing them, the user selects how many to print and I need to add a progress bar to the printing process so that it says something like: printing 3 of 7 or similar, but I don't know how to.
any ideas how to get this done?
EDIT:
I am using FastReports for printing the label and I basically set:
report.PrintOptions.Copies:= x;
report.Print;
the report's printer is set to the same printer that Tprinter is set, I set them with Printer.PrinterIndex:= Printer.Printers.IndexOf('My Printer');
Related
I have a TListView in vsSmallIcon mode. If I populate it with 2 items and first item text is longer than second item text it will draw first item over the second.
Is there a quick way to replace longer items with ellipsis? Or a complicated one?
I am using Delphi 2010 and C++ Builder 2010 with default settings of TListView
How it looks:
How I want it to look:
Edit: After trying out vsList style I discovered that the above is no longer an issue and it works without any additional code (no ellipsis but no items clipped also).
When working with TListView I often find myself investigating and mimicking the behavior of Windows Explorer.
Regarding your question with ellipsis in vsSmallIcon mode I checked out Explorer. I observed that when I resize the window there’s no ellipsis drawn for item captions. Instead the items are rearranged instantaneously. My suggestion would be to skip the ellipsis strategy because Microsoft has not implemented Explorer that way and chances of a quick fix for you decrease. If you can settle for rearranging then the two following “quick” alternatives should do the job, at least in XE3.
Alt 1:
ListView1.IconOptions.AutoArrange := true;
Alt 2: (must be called explicitly every time you desire a rearrangement):
ListView1.Arrange(arDefault);
Update:
I fired up Delphi 2006 and can confirm that the above methods work there as well
I'm a Delphi programmer and I'm trying to write an application in which I want to show text from a telnet server.
For inputting the commands to send I'm using a TLabeledEdit and for receiving the data I'm using TIdTelnet. That works without any problems so far.
But which component should I use to display the text so the output looks like the console window?
Should I use a multiline TLabel and place it into a TScrollBox or a TMemo with TabStop property set to False or is there a better solution?
Just use a TMemo (or its alternative, TRichEdit).
You can use a TListBox if wish to add additional functionality like painting the background of certain lines of text.
I'm trying to develop a report in Delphi XE4 and Report Builder 15.01 using CodeBar component.
When I print to screen the print is normal, but when I send that print to the printer, the codebar component disappear from the print, leaving just a blank space in its place.
I'm not changing its properties in runtime.
What could it be?
Edit:
The CodeBar component only disappear when the device is "Printer", if I change it to PDF for example, it prints correctly.
Edit2:
I have found another behavior: the Codebar doesn't disappear, it creates another codebar inside, with the same properties, but just visually. I could post images to make thing much clearer but i don't have anough rep points. lol.
Edit3:
I have tryed the version 14 and for my surprise the problem doesn't exist. I guess it's a bug from RB.
Well, after changing the version to 14 the problem has been solved. Not only this problem but some others layout problems.
On the program I am working on for a school project, there is a results page which displays the contents of a database in a DBGrid using a ADOQuery component. I have a button on the page which when I click it, it should print whatever the contents of the DBGrid is with a printer.
The printer setup is already done with a PrintDialog component, I know how to do that part, the problem is finding a way to print the contents of DBGrid.
The desired result would be to print all the data in the DBGrid, not just that shown on screen but whatever might be found if you scroll down in the DBGrid, as it is shown on the DBGrid onto a page, that could be printed to a physical paper or a electronic document, as chosen in the PrintDialog component.
I'll check up on the FastReports thing as suggested by some commentors. Does that have any dependancies when the program is run on another computer, as in does the computer also need FastReports installed?
Is this possible? If it is, how? Thanks in advance for any help in this matter.
I'm sorry if the question was/is not clear enough, I thought it was clear enough but that just goes to show how inexperienced I am.
I'm developing a POS (pet project) and I'm thinking of adding a bar code scanner to capture the sales faster. I do not have a scanner at the moment with me, and would like to ask some questions, as I'm stuck a bit.
On the sales screen my initial idea was to have an TEdit component and when a person scans the product it would fill the TEdit with the string. Now the problem I'm encountering is that I want to make the TEdit invisible so that the person does not see it. But once you make the TEdit invisible, you cannot set focus on it, so that plan cannot work.
So can anyone suggest what I can use to "capture" the scanned string? How would I make the component to listen and wait for the scanner? I assume that the scanner would be like a normal keyboard event, like button down or up.
There's KeyPreview property on TForm. Set it to true, so all key presses are processed by form first before controls.
Article about keyboard processing in Delphi: http://delphi.about.com/od/objectpascalide/a/keyboard_events.htm
Related SO question: How does Delphi's KeyPreview work?
What I have done is use the KeyPreview to monitor for a function key like F9 which the bar code scanner is set to prefix scans with. When this is received, I pop up a dialog with a single edit box and OK button. This then receives the rest of the barcode information, and the scanner ends the entry with the Enter key. I can then determine the purpose of the scanned data (in my case, one type starts with a prefix) and then put the data into the appropriate field on my main form.
I chose F9 because it seems inert in most applications, so you can use the scanner in other ways, but I support other keys too for flexibility. My application also has a scanner test mode where it shows the keys sent.
You can use a TEdit with a height and width of 0 so it won't appears and make sure it get focused when you scan your barcode.
You can also place the TEdit outside of the visible window, setting the component's Top and Left properties to something like -50. You can then set focus to it just like a regular visible TEdit box, but it will be invisible to the user.