delphi-2010

Draw opacity ellipse in Delphi 2010

拟墨画扇 提交于 2019-11-29 15:02:02
问题 I am looking to draw an opacity ellipse in CodeGear Delphi 2010. I had tried to draw to an another bitmap, I had set the bitmap transparent color(for background) Call the ellipse method. And in my image I draw the bitmap with opacity parameter(from overload). But it doesn't work. I want something like this http://www.java2s.com/Tutorial/VBImages/WPF-UseOpacityMaskAndRadialGradientBrush.PNG Does anybody know an working method? 回答1: It works for me: procedure TForm1.Button1Click(Sender: TObject

consuming web service with authentication allways give message Authentication required

半腔热情 提交于 2019-11-29 14:50:44
I try to use consume one web service with Delphi 2010. This web service is on port 8000 with authentication. I implement the function TForm4.EncodeLoginPW(const ALogin, APW: string): string; begin Result := EncdDecd.EncodeString(ALogin + ':' + APW); // EncdDecd is not documented in end; procedure TForm4.HTTPRIO1HTTPWebNode1BeforePost(const HTTPReqResp: THTTPReqResp; Data: Pointer); var s: string; begin s := 'Authorization: Basic ' + EncodeLoginPW(UserName, Password); if not HttpAddRequestHeaders(Data, PChar(s), Length(s), HTTP_ADDREQ_FLAG_ADD) then ShowMessage('HttpAddRequestHeaders' +

Why is the Compiler warning that variable may not be initialized?

丶灬走出姿态 提交于 2019-11-29 14:34:10
I am getting a compiler warning I don't understand: procedure Test; var Var1: Integer; begin while True do begin try if System.Random > 0.5 then begin ShowMessage('Skipping'); continue; // If I remove this line, the warning goes away end; Var1:=6; except on E:Exception do begin ShowMessage('Error'); raise; end; end; ShowMessage(IntToStr(Var1)); // Compiler warning on this line end; end; When I compile this in Delphi 2010 I get: [DCC Warning] OnlineClaimManagerMainU.pas(554): W1036 Variable 'Var1' might not have been initialized If I remove the call to 'continue', the warning goes away. Also,

Why does my program crash when I destroy a button in its own OnClick handler?

可紊 提交于 2019-11-29 14:09:02
I tried a script from a web site I run http://www.delphi-central.com/runtime.aspx and succeed. private { Private declarations } procedure CustomButtonClick(Sender: TObject); procedure TForm1.AddNewButtonClick(Sender: TObject); var NewButton : TButton; begin NewButton := TButton.create(self); with NewButton do begin Top := 30; Width := 60; Left := Width * (self.ControlCount-2); Parent := self; OnClick := CustomButtonClick; Caption := 'Button '+ inttostr (self.ControlCount-2); end; //With end; procedure TForm1.DeleteLastButtonClick(Sender: TObject); begin if Self.ControlCount>2 then TButton

Add graphical bar to a StringGrid col

不打扰是莪最后的温柔 提交于 2019-11-29 10:39:47
Using Delphi 2010 and a TStringGrid component, I currently display five filds from a database query. Here is a simplied example of what i am doing //set up the grid procedure TGriddata.FormCreate(Sender: TObject); begin grdMain.Rows[0].commatext:='"One","Two","Three","Four","Five"'; grdMain.ColWidths[0]:= 50; grdMain.ColWidths[1]:= 175; grdMain.ColWidths[2]:= 175; grdMain.ColWidths[3]:= 100; grdMain.ColWidths[4]:= 300; end; //display the data in the grid //note, I am not showing my creation, execution, or destroy of the query procedure TGriddata.load; begin ... grdMain.Cells[0,row]:=

Is there any new ORM for Delphi 2010? [closed]

烂漫一生 提交于 2019-11-29 08:17:10
问题 Delphi 2010 has new features regarding the RTTI, which I read it will make it easier for ORM tools and much cleaner code. but I have not found any ORM incorporated these features. Do you think the Embarcadero should built one and include it with Delphi 回答1: The Spring framework (which uses Delphi 2010 extended RTTI) has an Entity Framework on its roadmap: http://code.google.com/p/delphi-spring-framework/ Delphi Spring Framework is an international open source project, whose mission is to

How to allow Delphi secondary forms behind the main form

十年热恋 提交于 2019-11-29 07:47:39
If in Delphi 2010 or XE Application.MainFormOnTaskbar is set to true then all secondary forms are always in front of the main window. It does not matter what the Popupmode or PopupParent properties are set to. However I have secondary windows that I want to be able to show behind the the main form. If I set MainFormOnTaskbar to false it works, but then the Windows 7 features are broken (Alt-tab, Windows bar icon, etc). How can I keep the Windows 7 features working while still allowing secondary forms to hide behind the main form? Basically you can't. The whole point of MainFormOnTaskBar is to

How can I update a DataSnap server while clients are still connected?

天大地大妈咪最大 提交于 2019-11-29 07:22:30
We use stateful DataSnap servers for some business logic tasks and also to provide clientdataset data. If we have to update the server to modify a business rule, we copy the new version into a new empty folder and register it (depending on the Delphi version, just by launching or by running the TRegSvr utility). We can do this even while the old server instance is running. However, after registering the new version, all new client connections will still use the currently running (old) server instance . All clients have to disconnect first, then the new server will be used for the next clients.

Best Lightweight HTML Parser for Delphi

懵懂的女人 提交于 2019-11-29 04:23:55
I need to parse out the values from some data from select boxes. Example: <option value="1">Apple</option><option value="2">Chicken</option> Usage: If option = apple then get value. Any suggestions? DIHtmlParser ? I'm not sure how "lightweight" it is, but Ralf's components always seemed to be well put together. He's also normally active and response on Embarcadero's Forums. If it's a one-off and not too complex, you could probably split on symbols manually. Another option would be the standard XML Parsers...that is if your document meets the XHTML standards. 来源: https://stackoverflow.com

Focus next control on enter - in overridden KeyUp

放肆的年华 提交于 2019-11-29 02:04:11
I have my custom class that extends TEdit: TMyTextEdit = class (TEdit) private fFocusNextOnEnter: Boolean; public procedure KeyUp(var Key: Word; Shift :TShiftState); override; published property FocusNextOnExnter: Boolean read fFocusNextOnEnter write fFocusNextOnEnter default false; end; In The KeyUp procedure I do: procedure TMyTextEdit.KeyUp(var Key: Word; Shift: TShiftState); begin inherited; if FocusNextOnExnter then if Key = VK_RETURN then SelectNext(Self as TWinControl, True, false); end; But it isn't moving focus to the next control. I tried to if Key = VK_RETURN then Key := VK_TAB; but