![]() |
|||||||||||||||||
|
|
|||||||||||||||||
|
|
|||||||||
|
Delphi |
DELPHI DEVELOPER SUPPORT
Areas of concentration under: vcl
Area: vcl\additional controls Problem: When calling BeginDrag for a speedbutton inside ot the Mousedown event, the speed button is never repainted after it has been painted as pressed. When you drag off of the speed button the drag operation works correctly but the speedbutton stays depressed and never returns to the up position. Steps:
1) Put a speedbutton onto a form.
2) Double click on the OnMouseDown event.
3) Put in the following line of code for the event.
SpeedButton1- > BeginDrag(true);
4) Run the program and drag the SpeedButton and
then release it.
5) The drag works properly but the SpeedButton
says depressed.
Area: vcl\additional controls\tbitbtn Problem: Button pressed drawing is incorrect. Steps: The background of the arrow of the IDE should look like the tools on the palette. Instead it looks like it is offset by a few pixals making it look way too black. Area: vcl\additional controls\tchecklistbox Problem: Check mark of TCheckListBox do not save when use Items- > Exchange method. Steps: 1.Put on TCheckListBox. 2.Add some items. 3.Execute. 4.Check On some items. 5.Do CheckListBox1- > Items- > Exchange(0,1); Area: vcl\additional controls\tcontrolbar Problem: Deleting second button on TToolBar gives an AV: Access violation at address: 77F6CC66 in module 'ntdll.dll'. Write of address 00000010. Occures on Win98 beta 3 and NT4.0 server sp3. Delphi RC3 Area: vcl\additional controls\tcontrolbar Problem: TControlBar doesn't resize any of its controls when you scale a form. Steps: * Drop a TControlBar on a form * Drop a TButton and a TCheckBox in the controlbar * Right click, select Scale * Enter 50, click OK // Note that the button and checkbox have the same size Area: vcl\additional controls\tcontrolbar Problem: Control placed in controlbar loses dragging capability after dragging outside of controlbar area Steps: 1. Create a new project. Place a TControlBar on the form. 2. Place a control (any control will do, I've used a TPanel) on the TControlBar object. Leave the DragKind property of the new control as the default value of ckDrag). 3. Run the project. Start dragging the control (the panel) using the grip. You will be able to move it around the TControlBar, as if the DragKind property was set to ckDock. 4. Try dragging it outside the boundaries of the TControlBar. The cursor would change to the non-draggable cursor, and you won't be able to drag the panel anymore. Area: vcl\additional controls\tcontrolbar Problem: Dragging windowed controls outside a TControlBar, then aborting the drag put the controlBar in a strange "frozen" state. Area: vcl\additional controls\tcontrolbar Problem: With AutoDrag = False you can't undock controls by double clicking the nibs on the control bands, which is the default behavior when AutoDrag = True. One bad side effect is if a form is docked to a ControlBar with AutoDrag = False you can't undock it at all. Area: vcl\additional controls\tcontrolbar Problem: When moving a ControlBar's bands (?), if you move off the control bar there is a brief flicker showing the entire image of the control bar. Area: vcl\additional controls\tcontrolbar Problem: Docking fails when docked control dragged over Delphi's IDE windows. This happens even when the application is not being run in the IDE. This is in all versions of D4 (including Update 2 FT). Steps: Create a new application. Place a TControlBar on the new form, and a panel on the TControlBar. Set the panel's DragKind property to dkDock. Compile the program and run it. You don't have to run it from the IDE, but make sure Delphi is open. Drag the panel out of the TControlBar, and leave it as a floating window. Now start dragging this floating window over the IDE main form (for example, over the component palette), and leave it there. Move the mouse away from the window (no buttons are pushed now). The floating window frame will move with the mouse, ignoring the fact you have dropped the window. Area: vcl\additional controls\tmaskedit Problem: The FormatMaskText function does not work properly. The only thing this function seems to do is chop off characters if you've entered too many characters to check. It appears to not be formatting the value correctly. Steps:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics,
Controls, Forms, Dialogs,
StdCtrls, Mask;
type
TForm1 = class(TForm)
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Text := FormatMaskText('99999', ',?');
end;
end.
Area: vcl\additional controls\tmaskedit Problem: Submitted by user via web: MASK.PAS When I'd format using mask containing characters used mDirLiteral(\) followed by mMskTimeSeparator (:) or mMskDateSeparator (/), then / or : is evaluated not as literal but as time or date separator from .ini. This bug is in Delphi 1, Delphi 3. Delphi 4 I haven't. Area: vcl\additional controls\tscrollbox Problem: The scrollbox component is not setting the scrollable region properly. Creating a scroll box which contains an object that is larger than the client size results in either the vertical or horizontal scroll bar to go beyond the range by the width/height of vertical/horizontal scroll bar. Steps:
I've put an GIF of a < ALT > - < PRINT
SCREEN > of the form on:
http://www.digitalpaws.com/adam/window.gif
1) Open a new application.
2) Add a scrollbox to the form.
3) Add a shape to the scrollbox.
4) Set the width and height of the shape to a large
number (e.g. 1024).
5) Compile and run the application.
6) Scroll to scroll box to the bottom right.
UNIT1.DFM:
object Form1: TForm1
Left = 190
Top = 107
Width = 272
Height = 223
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object ScrollBox1: TScrollBox
Left = 0
Top = 0
Width = 264
Height = 196
Align = alClient
TabOrder = 0
object Shape1: TShape
Left = 0
Top = 0
Width = 1024
Height = 1024
end
end
end
UNIT1.PAS:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics,
Controls, Forms, Dialogs,
ExtCtrls;
type
TForm1 = class(TForm)
ScrollBox1: TScrollBox;
Shape1: TShape;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
end.
PROJECT1.DPR:
program Project1;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
Area: vcl\additional controls\tspeedbutton Problem: Speed Buttons with 'Flat' property set to TRUE stay raised after cursor passes accross them. The Speed Buttons 'MUST' be on a CoolBar component to see this bug. Area: vcl\additional controls\tsplitter Problem: TSplitter.MinSize have problem. Assuming that TSplitter.Align is alLeft, If Splitter move to left edge of Form, Splitterwill move to Left edge. And If resize a form by left edge, Splitter will disable. Steps: 1. Create a new application. 2. Drop TPanel in Form1. Set Panel1.Align to alLeft. 3. Drop TSplitter in Form1 3. Drop TPanel in Form. Set Panel2.Align to alClient. 4. Compile and Run. 5. Glab a splitter by mouse, and move to left. 6. Panel1 will vanished. 7. Resize form1 used by left edge 8. Can not glab a splitter. Area: vcl\additional controls\tsplitter Problem: The Canvas property of TSplitter is not public, so you can't use the OnPaint event. This is documented as if the Canvas property is public. Area: vcl\additional controls\tsplitter Problem: TSplitter needs a Visible property. When using a Splitter besides a pane that can be hidden by the user, it would be desirable to have the splitter be hidden too. Area: vcl\additional controls\tsplitter Problem: The TSplitter seems to have a problem when when dragged below its MinSize. Steps: For example, drop a TPanel on a blank form, align it left. Drop a TSplitter on the form, alight it left, with default MinSize of 30. Drop another TPanel on the form, aligned client. Run the program, then drag the TSplitter all the way to the right. It correctly limits the Minsize of the panel. Now drag the TSplitter all the way to the left. The left panel gets sized to zero instead of the TSplitter's MinSize. Click on the TSplitter and its drag image is displayed where the MinSize should be. Now Maximize the form with the TSplitter all the way to the left. The TSplitter can't be dragged anymore, even when the form is restored to its original size. Area: vcl\additional controls\tsplitter Problem: TSplitter AutoSnap/AutoHide property is not exist. Area: vcl\additional controls\tsplitter Problem: The Splitter retains the crHSplit or crVSplit cursor when escape is pressed. Area: vcl\additional controls\tstringgrid Problem: The TStringGrid OnSetEditText event is fired every time the user presses a key Steps: 1. Drop a TStringGrid on the form 2. Add goEdit to the options property 3. Add a OnSetEditText event handler, run the application. Note that the event fires for every key press while in edit where it should fire when the user has left the cell after an edit. The docs state that "Occurs when the user has finished editing the value of a cell.", but this behavior seems contrary to that description. Either this is a doc bug or the event if misfiring. Area: vcl\additional controls\tstringgrid Problem: Consecutive comma's in SDF CommaText do not seem to be parsed as empty strings Steps: File | New application Drop a StringGrid on the form In a button click add the following code var TheString: String; begin TheString := ',,1'; StringGrid.Rows[0].CommaText := TheString; end; // StringGrid.Cells[0][0] is '1' and not '' as I would have // expected; Area: vcl\additional controls\tstringgrid Problem: TStringGrid not repainting properly Steps: 1. place a TStringGrid component on a form. (Make sure there are more columns than fit in the grid's width, so the horizontal scroll bar is visible. It is also a good idea to make sure the right edge of the grid is in the middle of a column) 2. Run the program, and press Ctrl-End to move to the last cell of the grid. A few pixels from the header row will remain on the right side of the control. Area: vcl\core vcl classes Problem: The Constraints.AnchorHorz and Constraints.AnchorVert don't work properly on controls when their immediate container is a Form with AutoScroll set to True. Workaround: set AutoScroll to False. Steps: 1. Place Button1 on Form1 near the right edge. 2. Set Constraints.AnchorHorz to akMove. 3. Resize form's width using mouse in quick movements -- notice that scrollbars sometimes appear on form. Area: vcl\core vcl classes Problem: CM_CANCELMODE message is not getting called when grabbing the title caption and moving the window or when resising a window. Steps: Place a TTable, TDataSource, TDBLookupComboBox on a form. Connect TTable to DataSource1 TDataSource to DBDemos Database, Animals table and Active to True Connect TDBLookupComboBox's ListSource to TDataSource1, and set ListField and KeyField to NAME. Run the application Drop down the drop down, and then resize the form or move the form using the titlebar.. The drop down does not close because it does not get the CM_CANCELMODE message. Area: vcl\core vcl classes Problem: TApplication.UpdateVisible should not make the application window visible in the following case: - you are building a DLL in Delphi that contains a Form, which is intended to be created as a child of a foreign window (i.e.that's not implemented in Delphi). - the Application.Handle window is a foreign window handle (in this case, the window handle of the encapsulating frame window) - the Application.Handle window is hidden. - after creating the Form initially hidden, you then set Form.Visible := True. This last step sets the Visible property to True and then eventually calls Application.UpdateVisible. TApplication.UpdateVisible will loop through all the Forms and if any are visible it will make the Application visible as well. The problem is that this code assumes all the forms are top-level windows and not child windows. In general, making a child window visible does not necessarily cause its parent to become visible, and only when the parent becomes visible do all the windows appear on the screen. Workaround:
Here is a rewrite that works around the problem:
procedure TApplication.UpdateVisible;
....
var
I: Integer;
begin
if FHandle < > 0 then
begin
begin
if FHandle < > 0 then
begin
for I := 0 to Screen.FormCount - 1 do
// If form is visible, show the Application.
// But don't if the form is a child of a non-Delphi
window,
// since if that is hidden then calling SetVisible
will cause
// it to become visible.
with Screen.Forms[I] do
if (Visible and
((ParentWindow = 0) or (not IsChild(
FHandle, ParentWindow )))) then
begin
SetVisible(True);
Exit;
end;
SetVisible(False);
end;
end;
Area: vcl\core vcl classes Problem: The implementation of the new routine Forms.KeyboardStateToShiftState is faulty. It fails to correctly ascertain whether certain keys are pressed down or not The routine in question is only used in the implementation of the mousewheel event support (as far as I can see), but this simple code in the Steps section should hopefully demonstrate the point. Note that in the code supplied, there is an OnKeyPress event handler that uses KeyboardStateToShiftState to see if the Ctrl key is down. Area: vcl\core vcl classes Problem: TWinControl.Canfocus does not check to see if the form itself is visible/enabled. Steps: 1. File | New Application 2. File | New Form 3. Place a button on form1 with the following code: if Form2.Canfocus then Form2.SetFocus; 4. Compile/run the application and press Button1 // Notice that an exception occurs Area: vcl\core vcl classes Problem: Moving the mouse over a disabled menu item draws the selection and hides the text. It should not draw the selection. [Note: this only happens if the clHighlight system color is = to the clBtnShadow system color. - rbr] Area: vcl\core vcl classes Problem: [ TStrings ] LoadFromFile requires exclusive access to a file or it will fail. When calling TFileStream.Create it should use "fmOpenRead or fmShareDenyWrite" instead of only "fmOpenRead". Area: vcl\core vcl classes Problem: If you define your own collection property, you must call ReadValue before you call ReadCollection or you'll get an error. Steps:
o Comment out the ReadValue in
TQuery.ReadParamData().
o Recompile
o Drop down a TQuery add a SQL statement ("
select * from customer where custno = :CustNo")
o Run the project.
Area: vcl\core vcl classes Problem: The Anchors property doesn't perform correctly when the WindowsState of a form is set to wsMaximize. Area: vcl\core vcl classes Problem: The problem is with GetFormImage most nest windows controls like comboboxes, etc. are drawn blank. Area: vcl\core vcl classes Problem: The TThread.WaitFor method can't be used for threads where the FreeOnTerminate property is set true. This is because the FHandle field of the TThread object is accessed after the thread has terminated and, if FreeOnTerminate was true, after the object has been freed. My suggestion is to store the value of FHandle locally and use the local variable instead of FHandle. Steps:
Concrete suggestion:
function TThread.WaitFor: Integer;
var
Msg: TMsg;
H: THandle;
begin
H := FHandle;
if GetCurrentThreadID = MainThreadID then
while MsgWaitForMultipleObjects(1, H, False,
INFINITE,
QS_SENDMESSAGE) = WAIT_OBJECT_0 + 1
do PeekMessage(Msg, 0, 0, 0, PM_NOREMOVE)
else WaitForSingleObject(H, INFINITE);
GetExitCodeThread(H, Result);
end;
Area: vcl\core vcl classes Problem: The Align property is interacting with the new Anchors property in a way that breaks old code and causes very strange side effects. For example, by changing the Align property of a component, it is possible for the component to "disappear" from the form, because its width has been set to 0. The point is that the Align property should not be controlled by the Anchors property and vise-versa. And although there is a work-around it is certainly not an acceptable solution. Area: vcl\core vcl classes Problem: WindowState property is not reported correctly in FormResize Steps:
From the dellphi bug list: (using D4 update 2 beta)
A Form's WindowState property is not reported
correctly in the FormResize event when
maximizing/minimizing/restoring. The WindowState
property gets updated AFTER the FormResize
event.
To fix this bug, you need to edit the
FORMS.PAS file. I haven't attempted a workaround
that doesn't involve editing the VCL code,
although I'm sure it would be possible by
trapping the WM_SIZE message.
You need to adjust the TCustomForm.WMSize
procedure so that the "inherited" line comes
AFTER the case statement that sets the
WindowState property. i.e.:
procedure TCustomForm.WMSize(var Message:
TWMSize);
begin
{inherited;} // remove this line
if not (csDesigning in ComponentState) then
case Message.SizeType of
SIZENORMAL: FWindowState := wsNormal;
SIZEICONIC: FWindowState :=
wsMinimized;
SIZEFULLSCREEN: FWindowState :=
wsMaximized;
end;
inherited; // move line to here.
RequestAlign;
......
Area: vcl\core vcl classes Problem: The crSize cursor constant is invalid. Area: vcl\core vcl classes Problem: the function VarArrayFromStrings includes both the name & the value pair in each entry. I would think that it should only have the Name or perhaps the values in a second diminsion. The work around is to not use the method. Steps:
1) In the following example the output string will
include both the name & the value in the single
diminsion of the variant array:
var
vMachines: olevariant;
vList: TStringList;
i: integer;
begin
Edit1.Text := '';
ListBox1.Items.Clear;
vList := TStringList.Create;
for i:=0 to 9 do
begin
vList.Add('Test' + IntToStr(i) + '=');
vList.Values['Test' + IntToStr(i)] := IntToStr(i);
end;
Edit1.Text := IntToStr(vList.Count);
vMachines := VarArrayFromStrings(vList);
vList.Free;
for i := 0 to VarArrayHighBound(vMachines, 1) do
ListBox1.Items.Add(vMachines[i]);
end;
Output:
Test0=0
Test1=1
Test2=2
...
when I would expect:
Test0
Test1
Test2
Area: vcl\core vcl classes Problem: The Anchors property causes a visual display problem upon certain resize operations Steps: Make sure you are using a version of Windows that has the option of having window contents display whilst dragging turned on. I am using Windows 95 Place a DBGrid on a form Use the Anchors property and make sure all four possible elements are included in the set Now resize the form (either at design-time or at run-time) so that the form shrinks and the gris shrinks in tandem When the grid gets small enough for the column headers to get clipped, keep shrinking the form When the form is sized, such that the grid is almost non-visible, start enlarging the form again Notice that the column headers are redrawn very badly. To remedy the problem you need to invalidate the grid Area: vcl\core vcl classes Problem: The TStringList.CommaText property does not work correctly if the last item entered in the CommaText property is a NULL. Steps:
Add the following code to a project:
void foo(void){
TStringList *sl = new TStringList;
sl- > CommaText = "A,B,C,D";
int count = sl- > Count;
sl- > CommaText "A,B,C,";
if (sl- > Count != count){
throw Exception ("Welcome to the Builder
CommaText Bug!: " + String (sl- > Count));
}
}
there should be 4 items in the string list but it shows
as three.
Area: vcl\core vcl classes\streaming Problem: The VCL streaming code does not handle published variant properties with Null values when converting to and from text. Steps: Drop a TQuery. In the SQL put: :p1 :p2 In the params editor, select ftInteger for the datatype of each param. Set the value of the first param to Null (from the type drop down) and the second param to 0. Try to view the form as text. Area: vcl\core vcl classes\tform Problem: The VertScrollBar and HorzScrollBar.Size can't be reset to it WIn95 default after it value has changed. If we set it back to 0 it should set to the default size. Steps: 1. Place some compnents on a TForm 2. Resize the form so it is smaller the the components. Scrollbars are now displayed. 3. Set HorzScrollBar.Size to 50 4. Set HorzScrollBar.Size back to 0 The default value isn't set. Area: vcl\core vcl classes\tform Problem: Anchors don't work correctly for components on forms whose Position property isn't set to poDesigned or poDefaultPosOnly. Area: vcl\core vcl classes\tform Problem: Cannot minimize the main form after closing modally shown form form a dll compiled with runtime packages Area: vcl\core vcl classes\tform Problem: Setting TForm.Align to anything other than alNone causes other visible forms (with Align < > alNone) which happen to be parented (i.e. Parent < > nil) to flicker like crazy. Steps: 1. Set Form1.Align to alTop 2. Set Form2.Align to alClient 3. Create a Form3 (Align = alNone) 4. Make sure for all forms Visible = True 5. In Form3.FormCreate: Form2.Parent := Form3 6. Run and resize Form3 - notice incorrect alignment of Form2 and crazy flicker. Area: vcl\core vcl classes\tform Problem: The OnActivate of TForm fires before the OnCreate event under some circumstances. This can cause problems with existing code that depends on the form being fully instantiated at this point. This was not the behaviour in previous versions. Steps: 1) Create a 2nd Form in an applicaiton. Leave it autocreated and not visible. 2) AutoScroll := True; 3) Drop a button on the form and shrink the form so that the button is partially out of the viewable area (i.e. the scrollbar should automatically appear. 4) Create event handlers in OnCreate and OnActivate of the form. 5) Set break points or what ever to see that the OnActivate fires BEFORE the OnCreate Area: vcl\core vcl classes\tform Problem:
In FORMS.PAS, TScreen.DestroyCursors does not
free one of the cursors :
procedure TScreen.DestroyCursors;
var
P, Next: PCursorRec;
Hdl: THandle;
begin
P := FCursorList;
while P < > nil do
begin
if (((P^.Index > = crSqlWait) and (P^.Index < =
crDrag))
or (P^.Index = crHandPoint))
//modification
or (P^.Index > 0) then
DestroyCursor(P^.Handle);
Next := P^.Next;
Dispose(P);
P := Next;
end;
Hdl := LoadCursor(0, IDC_ARROW);
if Hdl < > FDefaultCursor then
DestroyCursor(FDefaultCursor);
end;
Steps: Customer recommends adding this line. Moving on for verification. Area: vcl\core vcl classes\tform Problem: when minimizing a maximized MDI child Form, the title bar gets placed a touch to low in the MDI parent Form causing vertical scroll bars to appear in the parent. Steps: 1. File | New... Projects, MDI Application 2. Run the project. 3. Create a new Child Form. 4. Maximize the Child Form. 5. Minimize the child Form. Vertical scrollbars now appear in the parent Form Area: vcl\core vcl classes\tform Problem: TCustomForm.OldCreateOrder does not have a default value, so it is always stored in the DFM. I don't think you'd want this for boolean values. Area: vcl\core vcl classes\tform Problem: When printing a TForm the top and left borders of the printed image have a black line. This black line was not there in Delphi 3 applications, it started showing up in Delphi 4. Steps:
1. Start a new project
2. Drop a button on the form
3. Double click on the button and type:
Form1.Print();
4. Run project (press the little green play button)
5. When application comes up click "Button1"
6. Get up and go to the printer
7. Pick up the piece of paper that printed and look
at it
8. See a black line on the top and left boarders of
the printed image. It should not be there.
Area: vcl\core vcl classes\tform Problem: A very hand debug tool is to turn on $APPTYPE CONSOLE in a GUI application to enable writeln of debug messages etc to the console. The forms in the application continue to work as before. However in D3, this is not fully supported, because the VCL code checks the IsConsole variable at run-time and the result is that all the forms in the application gets an icon in the task-bar, not just the main window. Problem: In Forms you have: procedure TApplication.CreateHandle; var TempClass: TWndClass; SysMenu: HMenu; begin if not FHandleCreated and not IsConsole then begin I.e. the Application Handle is only created if IsConsole returns false. TApplication.CreateHandle is called from TApplication's Create constructor when IsLibrary is false. TApplication is created from the InitControls procedure in Controls and the InitControls procedure is called in the initialization part of Controls. Area: vcl\core vcl classes\tform Problem: It appears scrolling a form in Delphi 4 is 50 to 100% slower than Delphi 3. [ I see 9.84 sec vs 4.36 sec - about 100% - MD] Steps:
Compare following code in Delphi 3 and Delphi 4.
var i: Integer;
t1,t2: TDatetime;
e: Integer;
begin
Screen.Cursor := crHourGlass;
t1 := Now;
for i := 1 to 400 do
begin
Label1.Left := 10+i;
Label1.Top := 10+i;
Label1.Width := 100+i;
Label1.Height := 100+i;
end;
for i := 1 to 400 do
begin
Label1.Left := 10+i;
Label1.Top := 10+i;
Label1.Width := 100+i;
Label1.Height := 100+i;
end;
t2 := Now;
Label2.Caption := 'Testtime: ' +
FormatFloat('0.00',(t2-t1) * 100000) + ' sec';
Screen.Cursor := crDefault;
Area: vcl\core vcl classes\tscreen Problem: Screen.Fonts does not update in response to Wm_FontChange messages. Area: vcl\core vcl classes\tthread Problem:
Proper multithreading support is made even more
difficult with D4.
To allow the main thread to block on the message
queue as well as any
number of events, semaphores and threads, I've
implemented a
TMultiThreadedMainLoop class that hooks the
Application.OnIdle event
and calls MsgWaitForMultipleObjects.
When it detects that there is a message waiting in
the queue, it exits
the idle event handler returns to let
TApplication.HandleMessage
handle the message (sic). However, to ensure that
control returns back
to the OnIdle event handler to again call
MsgWaitForMultipleObjects,
it always sets Done := false before exiting. This
works nicely in D3,
but in D4 it has the side-effect of never calling the
new DoActionIdle
method:
procedure TApplication.Idle(const Msg: TMsg);
begin
...
Done := True;
try
if Assigned(FOnIdle) then FOnIdle(Self, Done);
if Done and IsIdleMessage(Msg) then
DoActionIdle;
except
on Exception do HandleException(Self);
end;
if Done then WaitMessage;
end;
My OnIdle handler (simplified):
procedure
TMultiThreadedMainLoop.AppIdle(Sender:
TObject; var Done:
boolean);
begin
repeat
WaitResult := MsgWaitForMultipleObjects(...);
if WaitResult = wrSignaled then
HandleSignal;
// Loop until we get a message
until WaitResult = wrMessage;
// Always return Done=false to signal that the
message loop should
go back here when it has read all messages
Done := false;
end;
As you can see from these snippets, the event sets
Done:=false to
avoid the blocking WaitMessage call in
TApplication.Idle. However,
this has the side-effect of never calling
DoActionIdle.
To add to the problem, the DoActionIdle method is
declared private, so
I cannot easily call it from my event handler. The
only resolution
seems to be to copy the functionality of
DoActionIdle into my class.
Not very nice when it comes to reuse.
Area: vcl\core vcl classes\twincontrol Problem: Constraints fail under certain configurations of controls using Align. Area: vcl\core vcl classes\twincontrol Problem: Strange behaviour when using the paintto method from twincontrol descendants, specially when used with panels which contain other panels inside, with components in them. Some components are not drawn, some are drawn bigger and, when the original object is not visible, nothing or a white rectangle is drawn. Steps: 1. create a new application 2. drop a panel of the form; create panel1 3. drop another panel on panel1; create panel2 4. drop a button on panel2; create button1 5. drop a paintbox component on the form; create paintbox1 3. drop another button on the form and on its onclick event execute the followimg statement: panel1.paintto(paintbox1.canvas.handle, 0, 0); 4. when the onclick event fires, panel1 is drawn containing panel2, but no button1 Area: vcl\dialog controls\tcolordialog Problem: When defining custom color, the user is to use the keyword ColorA=xxxxxxx. The word Color should not be resourced since it could easily lead to over-translation (as is the case with Delphi 3 and 4) Area: vcl\dialog controls\topenpicturedialog Problem: TOpenPictureDialog does not open specfied formats. Steps: 1. Drop a TOpenPictureDialog on a Form with a TButton. 2. within Button1Click do a OpenPictureDialog1.Execute. 3. Try to open any .jpg and an EInvalidGraphicFormat is raised with error invalid extension. (Graphics.pas, TPicture.LoadFromFile line3619). Workaround: The solution is to write code to assign OpenPictureDialog1.Filter := Graphics.GraphicFilter(TGraphic) at any time after the OpenPictureDialog1 component is loaded and before it is show to the user. Or, you can modify the OpenPictureDialog's Filter property at design time to delete the graphics file types that you do not intend to support in your application. Area: vcl\dialog controls\topenpicturedialog Problem: TopenPictureDialog can be pretty slow. Steps: What is the chance of having this thing use threads/processes? I have a bitmap that just brings Delphi to its knees. if I just happen to click on that bitmap - a takes couple of min trying to load the bitmap, then a min trying to close the dialog. Or if I click on another bitmap while trying to load this big one, it still takes a couple of min loading, then throws it away meaning if I click back, another 2 min... Area: vcl\dialog controls\tprintdialog Problem: TPrintDialog fails to honor the PrintToFile checkbox Area: vcl\dialog controls\tprintdialog Problem: TPrinterSetupDialog Dialog is always initialized with the default printer selected (changing Printer.PrinterIndex has no effect) Area: vcl\dialog controls\tprintersetupdialog Problem: Under Windows NT 4 (SP3) the printer dialog and printer setup dialog will always show the default printer, not the one chosen through Printer.PrinterIndex. Under Win95 (and Win 3.1 with D1) the PrinterIndex printer is the one chosen in the dialog. This can be worked around by calling Printer.GetPrinter followed by Printer.SetPrinter, with a 0 parameter for hDevMode, to force TPrinter to update its info. Steps:
The following event handler shows what is
neccessary to have the NT4 printer dialogs to show
the correct printer after PrinterIndex is set in code. If
the GetPrinter and SetPrinter calls are commented
out then the dialogs will always show the default
printer, not the PrinterIndex one.
procedure TForm1.Printersetup1Click(Sender:
TObject);
var
Device : array[0..255] of char;
Driver : array[0..255] of char;
Port : array[0..255] of char;
hDMode : THandle;
begin
Printer.PrinterIndex := 1; { set to any non-default
printer }
Printer.GetPrinter(Device, Driver, Port, hDMode);
Printer.SetPrinter(Device, Driver, Port, 0);
if PrinterSetupDialog1.Execute then begin
Memo1.Lines := Printer.Printers;
end;
end;
Area: vcl\docking Problem: Dragging off a TCoolBar causes an AV when the dragged control is released. Area: vcl\docking Problem: ManualDock does not work in the case where a control is not floating or already docked somewhere. Steps: Put a DockSite on a form. Put a dockable control on a form. Put a button on the form, in it's Onclick type: < dockable control > .ManualDock( < docksite > ); Run. Push the button. Nothing happens. Area: vcl\docking Problem: Resize splitters do not behave correctly when 3 or more dock clients are present. Steps: Run the docking demo and cojoin 3 color windows so that two are side by side on the bottom and one is one is on top of the other two. Try to move the splitter between the bottom two windows and notice that it will only move two the left a distance which is equal to the height of the top window. Area: vcl\docking Problem: Docking preview rect is not correct in some cases. Steps: Run the docking demo. Open three windows. Dock 2 side by side. Try to dock the third above the previous 2. Note the preview rect incorrectly shows the entire window instead of just the top half. Original Steps: 1) Conjoin dock object inspector and call stack side by side. 2) Grab any other dockible window and try to dock above the other Note the preview rect took up the entire tool window, not just the top of the tool window. Area: vcl\docking Problem: Turns out it was a TControlBar grabbing anything dragged over it. The TControlBar in this case was obscured by a TToolBar filling it's client area, so you couldn't see that the form had been docked -- all you saw was that it vanished and was no longer displayable. So, the bug is: TControlBar docks anything drug over it without that 'thing' being first dropped -- very bad. Steps: With AutoDrag = False, the behavior is as expected, Unfortunately the form cannot then be undocked from the ControlBar Area: vcl\docking Problem: Docking a TRichEdit to a TPageControl results in the tab sheet containing the entire text of the TRichEdit, including non-printable characters. Steps: Drop a PageControl on a form, add a couple of tab sheets, and drop a TRichEdit on a tabsheet. Set RichEdit DragKind to dkDock and DragMode to dmAutomatic. Make the PageControl a docksite. Add some more text to RichEdit.Lines. Run. Click the RichEdit, since it's dmAutomatic this will cause it to undock and re-dock to a new tab. Note the caption. Area: vcl\docking Problem: When attempting to dock any control to a control bar, the image of the control will remain improperly in the initial control that was dragged over. Steps: 1. Place two control bars in a form, one aligned Top and the other aligned Left 2. Drop a panel on the top one and set DragKind to dkDock and DragMode to dmAutomatic. 3. Run the application. 4. Undock the panel and release the mouse. 5. Grab the caption of the undocked panel and drag it over a controlbar. It will dock temporarily. 6. Continue moving the mouse so that it undocks that control bar and travels over the other. 7. Notice the image of the control remaining in the first control bar. Area: vcl\docking Problem: Floating window gets a bit of garbage in its caption [or, rather, TCustomDockForm uses the memo's text, and I mean ALL of it, as its caption - MD] Steps: Make a new application Add panel to form, making it just a bit smaller than the form itself is Set panel's DockSite to True Add a memo onto the panel Set Memo's Align property to alClient Set Memo's DragMode to dmAutomatic Set Memo's DragKind to dkDock Run app Drag memo off the panel and leave it floating Notice the caption of the floating window is Memo1 followed by two vertical bars, or squares (probably high or low ANSI characters) Area: vcl\docking Problem: When a dock client becomes visible it may not be restored to the location it was in before being hidden. Area: vcl\docking Problem: Docking into a Coolbar: Setting Source.DockRect inside of the CoolBar's OnDockOver event (to provide a preview rect) can cause unpredictable behavior, such as disapperaing bands Workaround: see readme.txt Area: vcl\drag\drop Problem: On any TControl, the OnStartDrag event is fired as soon as BeginDrag is called, not when the drag operation actually starts (when the threshold is exceeded). Original Description: TTreeView.BeginDrag starts dragging immediately, regardless of the values for "Immediate" and "Threshold" parameters. [This bug also applies to TListView - MD] Area: vcl\graphics Problem: When Changing the pixelformat of TBitmap to pf8Bit, CreateHalftonePalette leaks Steps:
var
orgbmp:TBitMap;
x: Integer;
begin
for x:= 0 to 10000 do
begin
orgbmp:=TBitmap.Create();
orgbmp.Width:=10;
orgbmp.Height:=10;
orgbmp.PixelFormat:=pf8bit; //here it
leaks
orgbmp.Palette:=
Image1.Picture.Bitmap.Palette;
Application.ProcessMessages;
orgbmp.free;
end;
Area: vcl\graphics Problem: The attached graphic is not streamed correctly. Streaming of RLE bitmaps appears to be broken. Steps: 1. File | New Application 2. Drop a TImage 3. Load the RLE bitmap into the image. 4. Select View Form as text 5. Select View as Form // Notice that part of the top of the bitmap is messed up. Area: vcl\graphics Problem: Matrox millenium , Diamond, Cirus. Riva 128, causes problems on a recompile D2 app with a Treeview. On WinNT 351 SP2 Also, corrupted icons in the IDE component palette. Steps: 1)The icons form the Image list are displayed as black. in the treeview 2)This happens even on a (640*480 16 colors) Standard MS driver. 3)The icons are 16x 16 and 16 colors. 4)The BDEadmin DOES NOT display this behaviour 5) the same app compiled with D2 does NOT show the same behaviour. Area: vcl\graphics Problem: When DDBsOnly is set to True, the Graphics unit will leak resources, but only on Win95. See line 5586 in Graphics.pas. Steps:
1. File | New Application
2. Drop a TButton down.
3. In the OnClick event handler for the button:
var
i : Integer;
begin
DDBsOnly := True;
for i:=0 to 9999 do begin
with TBitmap.Create do begin
LoadFromFile('C:\WINDOWS\WAVES.BMP');
Free;
end;
Caption := IntToStr(i);
Application.ProcessMessages;
end;
end;
4. Run and watch your resources go away...
5. The program will crash if you wait long enough.
On my machine, about 900 iterations
Area: vcl\graphics Problem: TGraphic.LoadFromFile opens the file in a mode that prevents other processes from concurrently reading from the file. Please change to opening it in a shared mode. Area: vcl\graphics Problem: RLE compressed bitmaps are not correctly unencoded by ReadDIB in Graphics.pas. Steps: 1. Add a TImage on a form. 2. Add the attached 256-color athena bitmap to the image. 3. Hit Alt+F12 to view the form's source. 4. Hit Alt+F12 again to stream-in the image. 5. Notice the black bands atop the image. Area: vcl\graphics Problem: [ TGraphic ] LoadFromFile requires exclusive access to a file or it will fail. When calling TFileStream.Create it should use "fmOpenRead or fmShareDenyWrite" instead of only "fmOpenRead". The same report has been submitted and fixed for TStrings but it appears that the file mode should be corrected for all objects in VCL that implement the "LoadFromFile" method. Area: vcl\mdi support Problem: Using a mousewheel in an MDI app causes a stack overflow. Area: vcl\printing Problem: TPrinter.GetPrinter fails to return the name of the currently selected printer driver Area: vcl\printing Problem: Add global variable and type to Printers unit: type TPrinterClass = class of TPrinter; var PrinterClass : TPrinterClass; Change the Printer function to create an instance of the class found in the PrinterClass variable rather than alwas a TPrinter. Set PrinterClass to TPrinter in the unit initialization. Area: vcl\property\type editors |