Search Results

Search found 8 results on 1 pages for 'lyborko'.

Page 1/1 | 1 

  • How to align MDIChild on left?

    - by lyborko
    Hi, I am trying hard to align MDIChild form to the left of the parent MDIForm setting Align:=alLeft at design time. Aparently aligned MDIChild is higher than parents client area (I do not know why), thats why vertical scrollbar appears on parent form. The problem is, that I want this form create dynamicaly; putting vertical Splitter between these MDIchild forms, in order to size them by mouse. But when I create Splitter it aligns itself totaly on the left, as if MDIChild form was not aligned (alLeft) at all. I set MDIChild parameters to: Align:=alLeft; Windowstate:=wsNormal; Borderstyle:=bsSizable; Does anybody solved this problem before? thanx a lot P.S Delphi 7, Win XP

    Read the article

  • How to use Data aware controls "correctly"?

    - by lyborko
    Hi, I would like to ask experienced users, if you prefer to use data aware controls to add, insert, delete and edit data in DB or you favor to do it manualy. I developed some DB applications, in which for the sake of "user friendly policy" I run into complicated web of table events (afterinsert, afteredit, after... and beforeedit, beforeinsert, before...). After that it was a quite nasty work to debug the application. Aware of this risk (later by another application) I tried to avoid this problem, so I paid increased attention to write code well, readable and comprehensive. It seemed everything all right from the beginning, but as I needed to handle some preprocessing stuff before sending and loading data etc, I run into the same problems again, "slowly and inevitably". Sometime I could not use dataaware controls anyway, and what seemed to be a "cool" feature of DAControl at the beginning it turned to an obstacle on the end. I "had to" write special routine for non-dataaware controls, in order to behave as dataaware. Then I asked myself, why on earth should I use dataaware controls? Is it better to found application architecture on non-dataaware controls? It requires more time to write bug-proof code, of course, but does it worth of it? I do not know... I happened to me several times, like jinxed : paradise on the beginning hell on the end... I do not know, if I use wrong method to write DB program, if there is some standard common practice how to proceed. Or if it is common problem to everybody? Thanx for advices and your experiences

    Read the article

  • Why the composite component fails to parent controls?

    - by lyborko
    Hi, I created my own Component : TPage , which Contains Subcomponent TPaper (TPanel). The problem is, that when I put controls such as TMemo or TButton on the TPaper (which fills up nearly whole area), the controls do not load at all. see example below TPaper = class(TPanel) protected constructor Create(AOwner: TComponent);override; destructor Destroy;override; public procedure Paint; override; end; TPage = class(TCustomControl) private FPaper:TPaper; protected procedure CreateParams(var Params:TCreateParams); override; public constructor Create(AOwner: TComponent);override; destructor Destroy;override; published property Paper: TPaper read FPaper write FPaper; end; constructor TPage.Create(AOwner: TComponent); begin inherited Create(AOwner); PaperOrientation:=poPortrait; PaperSize:=psA4; PaperBrush:=TBrush.Create; PaperBrush.Color:=clWhite; PDFDocument:=Nil; FPaper:=TPaper.Create(Self); FPaper.Parent:=Self; FPaper.SetSubComponent(True); end; ... Memo1 is parented in TPaper (TPanel) at design-time, but after pressing "Run" it does not exist. procedure TForm1.btn1Click(Sender: TObject); begin if not Assigned(Memo1) then ShowMessage('I do not exist'); //Memo1 is nil end; Have you any idea what's wrong? Thanks a lot P.S Delphi 7 When I put TMemo inside TPaper and save the unit (Unit1), after inspection of associated dfm file, there is no trace of TMemo component. (Thats why it can not load to app.)

    Read the article

  • How to use SetTextCharacterExtra in TEdit or TMemo?

    - by lyborko
    Hi, Does anybody know any component based on TEdit or TMemo, in which is possible to set different intercharacter spacing? Win API SetTextCharacterExtra solves the problem for Tcanvas, but I tried hard to implement this behavior as a property for my own TEdit Component (a year ago) and despite of my various desperate attempts to do this, I failed. Thanx in advance.

    Read the article

  • The same property and procedure in different Classes. How they can be accessed ?

    - by lyborko
    Hi, I created several new objects TMyMemo = class (TMemo) private FYahoo = Integer; procedure SetYahoo(Value:integer) public procedure Google(A,B:integer; S:string); published property Yahoo:integer read FYahoo write SetYahoo; end; TMyPaintbox = class (TPaintbox) private FYahoo = Integer; procedure SetYahoo(Value:integer) public procedure Google(A,B:integer; S:string); published property Yahoo:integer read FYahoo write SetYahoo; end; TMyButton = class (TButton) private FYahoo = Integer; procedure SetYahoo(Value:integer) public procedure Google(A,B:integer; S:string); published property Yahoo:integer read FYahoo write SetYahoo; end; . . . These Controls are placed on Form1. Is there a way, how can I change the same property (Yahoo) and run the procedure (Google), which is declared in different objects (inheritance is not possible) ? procedure Form1.Button1Click(Sender:TObject); var i:integer; begin for i:=0 to Form1.ControlCount-1 do begin Controls[i].Google(4,5, 'Web'); // this should be changed somehow Controls[i].Yahoo:=6; // this should be changed somehow end; end; end; Thanks

    Read the article

  • How to get TextWidth of string (without Canvas)?

    - by lyborko
    Hi, I would like to get text width of a string before an application starts. Everything works fine untill Application.MainForm canvas present. The problem is, when I try dynamicaly create TOrdinarium in the OnCreate event of the app. main form, "Canvas does not allow drawing" error occures. (Application.MainForm is nil....). I tried several ways to create Canvas dynamicaly (one of them is written below), but it can not measure text sizes without being attached to parented control. Is there way how to make it work somehow? Thanx I tried this: TOrdinarium = class (TCustomControl) private function GetVirtualWidth:integer; end; constructor TOrdinarium.Create(AOwner:TComponent); begin inherited; Width:=GetVirtualWidth; end; function TOrdinarium.GetVirtualWidth:integer; var ACanvas : TControlCanvas; begin ACanvas := TControlCanvas.Create; TControlCanvas(ACanvas).Control := Application.MainForm; ACanvas.Font.Assign(Font); result:=ACanvas.TextWidth('0'); ACanvas.Free; end;

    Read the article

  • How to free control inside its event handler?

    - by lyborko
    Hi, Does anybody know the trick, how to free control inside its event handler ? According delphi help it is not possible... I want to free dynamicaly created TEdit, when Self.Text=''. TAmountEdit = class (TEdit) . . public procedure KeyUp(var Key: Word; Shift :TShiftState); end; procedure TAmountEdit.KeyUp(var Key: Word; Shift :TShiftState); begin inherited; if Text='' then Free; // after calling free, an exception arises end; How should do to achieve the same effect? Thanx

    Read the article

  • Delphi: EReadError with message ‘Property PageNr does Not Exist’.

    - by lyborko
    Hi, I get SOMETIMES error message: EReadError with message 'Property PageNr does Not exist', when I try to run my own project. I am really desperate, because I see simply nothing what is the cause. The devilish is that it comes up sometimes but often. It concerns of my own component TPage. Here is declaration TPage = class(TCustomControl) // private FPaperHeight, FPaperWidth:Integer; FPaperBrush:TBrush; FPaperSize:TPaperSize; FPaperOrientation:TPaperOrientation; FPDFDocument: TPDFDocument; FPageNr:integer; procedure PaintBasicLayout; procedure PaintInterior; procedure SetPapersize(Value: TPapersize); procedure SetPaperHeight(Value: Integer); procedure SetPaperWidth(Value: Integer); procedure SetPaperOrientation(value:TPaperOrientation); procedure SetPaperBrush(Value:TBrush); procedure SetPageNr(Value:Integer); protected procedure CreateParams(var Params:TCreateParams); override; procedure AdjustClientRect(var Rect: TRect); override; public constructor Create(AOwner: TComponent);override; destructor Destroy;override; // function GetChildOwner:TComponent; override; procedure DrawControl(X,Y :integer; Dx,Dy:Double; Ctrl:TControl;NewCanvas:TCanvas); // procedure GetChildren(Proc:TGetChildProc; Root:TComponent); override; procedure Loaded; override; procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; procedure Paint; override; procedure PrintOnCanvas(X,Y:integer; rX,rY:Double; ACanvas:TCanvas); procedure PrintOnPDFCanvas(X,Y:integer); procedure PrintOnPrinterCanvas(X,Y:integer); procedure Resize; override; procedure SetPrintKind(APrintKind:TPrintKind; APrintGroupindex:Integer); published property PageNr:integer read FPageNr write SetPageNr; property PaperBrush: TBrush read FPaperBrush write SetPaperBrush; property PaperHeight: integer read FPaperHeight write SetPaperHeight; property PaperWidth: integer read FPaperWidth write SetPaperWidth; property PaperSize: TPaperSize read FPaperSize write SetPaperSize; property PaperOrientation:TPaperOrientation read FPaperOrientation write SetPaperOrientation; property PDFDocument:TPDFDocument read FPDFDocument write FPDFDocument; property TabOrder; end; I thoroughly read the similar topic depicted here: Delphi: EReadError with message 'Property Persistence does Not exist' But here it is my own source code. No third party. Interesting: when I delete PageNr property in my dfm file (unit1.dfm), then pops up : EReadError with message 'Property PaperHeight does Not exist'. when I delete PaperHeight then it will claim PaperWidth and so on... Here is piece of dfm file: object pg1: TPage Left = 128 Top = 144 Width = 798 Height = 1127 PageNr = 0 PaperHeight = 1123 PaperWidth = 794 PaperSize = psA4 PaperOrientation = poPortrait TabOrder = 0 object bscshp4: TBasicShape Left = 112 Top = 64 Width = 105 Height = 105 PrintKind = pkNormal PrintGroupIndex = 0 Zooming = 100 Transparent = False Repeating = False PageRepeatOffset = 1 ShapeStyle = ssVertical LinePosition = 2 end object bscshp5: TBasicShape Left = 288 Top = 24 Width = 105 Height = 105 PrintKind = pkNormal PrintGroupIndex = 0 Zooming = 100 Transparent = False What the hell happens ??????? I have never seen that. I compiled the unit several times... Encoutered no problem. Maybe the cause is beyond this. I feel completely powerless.

    Read the article

1