

Pat Foley
Members-
Content Count
437 -
Joined
-
Last visited
-
Days Won
2
Pat Foley last won the day on August 9 2023
Pat Foley had the most liked content!
Community Reputation
54 ExcellentTechnical Information
-
Delphi-Version
Delphi 12 Athens
Recent Profile Visitors
-
To fix your example set the tabstop to False on the Edit controls. Better to set the Key = 0 when Key = VK_RETURN is handled to let the focus move to next control (Excel style moves to next cell on enter). More important is have the tabs z-order end at a submit button that confirms the entries. Sample's editkeydown handles the Edits and a Listbox to let the user select the right item the first time rather a screen that covers not only the app but other running apps to fix typos. Also the InputBox allows an edit of its items. procedure TForm1.EditKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); var ii : Integer; s :string; begin var MoreZ := not (ssShift in Shift); if (Key = VK_RETURN) and (Sender is TEdit) then begin Key := VK_Tab; var Edit := Sender as TEdit; if not MoreZ then Edit.text := InputBox('Fixer', '?', Edit.text); SelectNext(Edit,MoreZ,True); end; if (Key = VK_RETURN) and (Sender is TListBox) then begin Key := VK_TAB; var LB := TListBox(Sender); SelectNext(LB,MoreZ,True); ii := LB.ItemIndex; if ii > -1 then s := LB.Items[ii] else begin s := 'Select something in' + LB.Name; MoreZ := True; end; if MoreZ and (ii > -1) then LB.Items[ii] := InputBox('lister', '?', s); end; end;
-
Did you use Turbo pascal Programmers Library by Jamsa back then and and how about Ready-to_Run Delphi 3 Algorithms both mention using generic coding for code reuse back then should help in learning code reuse and simply reusing someone else code now. Tstringlist.Commatext may be able to lift your old code and Format('%s,%,s', ['name', Number.tostring])to feed Stringgrid.Rows[0].commaText := 'name,Number';
-
mmm, I run win 11 are you still using DOS. procedure TForm16.Button4Click(Sender: TObject); var SL: TStrings; // F1 click bait begin SL := memo1.Lines; for var aDate in [0, 1,2,3, 30000-2*365-32-17 , 30000, 40000, 50000, 100000] do begin SL.Add(DateToStr(aDate)); end; end;
-
Memo lines{i] to labelv ok. Labels to Memo lines nope
Pat Foley replied to Freeeee's topic in General Help
By switching to Static text like a label but the advantage of windows handle so it be selected then you add a event to the win control like so. F2 is an Edit control. I'm sure Marco Cantu has much examples in his books. procedure TForm16.Clicker(Sender: Tobject); begin EZ := F2.Text; (Sender as TStaticText).Caption := EZ; end; procedure TForm16.RzButton1Click(Sender: TObject); var Labels: Array[0..9] of TStaticText; var stlabela: TStaticText; begin var count:= 0; for var stlabel in Labels do begin Labels[Count] := TStaticText.Create(Self); stlabela := Labels[Count]; stlabela.Parent := self; stlabela.SetBounds(24,20*count,50,23); stlabela.onClick := Clicker; stlabela.Caption := count.ToString; stlabela.Show; Inc(count); end; end; -
I actually looked at some JS code and Physics for Game Developers by Bourg for stuff on Quaternions. The Model-3D sample may be a start. Years ago at a talk about making the Matrix movie the speaker said the stuff in background was all 2D "decals". And it takes three years of schooling for 3D. (Also even a graphic artist needs know linux to get hired.) procedure TModel3DTest.Form3DMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single); begin if (ssLeft in Shift) and Mouse then begin DummyX.RotationAngle.X := DummyX.RotationAngle.X - (Y - Down.Y)* 0.3 ; DummyY.RotationAngle.Y := DummyY.RotationAngle.Y + (X - Down.X)* 0.3 ; Down.X := X; Down.Y := Y; end; end;
-
What making One Application for now. And Run it Three times at a time. set the Parameters Data1.dat , Data2.dat, Data3 for first app. set the Parameters Data2.dat , Data3.dat, Data1 for Second app. set the Parameters Data3.dat, Data1.dat, Data2 for Third app. ... procedure FindDeltas( const Param{1}, Param(2), Param(3)); begin Old code in here end; Is it a lazy steer that its 'looking' at?
-
What version I using 12.2 and tried this IDE insight and it works well with the keyboard. start Delphi Press <F6> and enter VCL Using down arrows select Windows Application Press<F6> enter VCL select VCL form Press<F6> Enter TButton Repeat above as needed. Press<F6> Enter Help
-
Looking for CBuilder/VS help on C open source project
Pat Foley replied to Vincent Parrett's topic in Job Opportunities / Coder for Hire
You are right. The files to look at is web.pas has var dom, console, and window. The js.pas uses JSValue and parses JSON objects unsure if the eval can do multiline. -
Looking for CBuilder/VS help on C open source project
Pat Foley replied to Vincent Parrett's topic in Job Opportunities / Coder for Hire
What about Lazarus pas2js This screen capture Shows the source in the js.pas. Its hid in the co..\pas2js\Demos -
Share a data between two units in dynamic loaded BPL.
Pat Foley replied to CRO_Tomislav's topic in VCL
Would not using global variables for any forms and using unique name for forms to use make it a better idea. To reduce complexity a TreeView is loaded in mainform with nodes referencing the forms being created. The Treeview can then be parented to the Active form to let the user navigate the app readily. A DM can help surfacing the data through the UI. -
Share a data between two units in dynamic loaded BPL.
Pat Foley replied to CRO_Tomislav's topic in VCL
You might to study and use this to move cursor to control being selected. I want to add it to IDE <F6> or <Ctrl>. function it only jumps to selection without any animation 🙂 procedure TTaskmaster.moveMouse(AtaskDetail: TInstruction); var x, y, MouseXError, MouseYError: integer; ControlCenter: Tpoint; AC: TControl; begin findControl(AtaskDetail, AC); if not assigned(AC) then exit; if assigned(AC.Parent) then AC.Parent.Show; AC.Show; x := AC.ClientOrigin.X + AC.width div 2; y := AC.ClientOrigin.y + AC.height div 2; begin MouseXError := round(1.12 *(x - mouse.CursorPos.X)); MouseYError := round(1.12 * (y - mouse.cursorPos.y)); // MouseXError := min(MouseXError, 10 * sign(MouseXError)); // MouseYError := min(MouseYError, 10 * sign(MouseYError)); controlCenter.X := mouse.CursorPos.x + MouseXError; controlCenter.Y := Mouse.CursorPos.y + mouseYError; mouse.CursorPos := ControlCenter; end; repeatTask := (abs(MouseXError) > 7) or (abs(MouseYError) > 7); end; -
Share a data between two units in dynamic loaded BPL.
Pat Foley replied to CRO_Tomislav's topic in VCL
This should yield control asked for. procedure TTaskMaster.findControl(AtaskDetail: TInstruction; var AC: TControl); var ff, ii : integer; sForm, sControl: string; begin with AtaskDetail do begin if Control <> nil then AC := Control else begin sForm := controlForm + ' not found.'; sControl := controlName + ' not found.'; //screens move about on windows list top window usually 0 :( for ff := 0 to Screen.FormCount - 1 do if Screen.Forms[ff].name = controlform then begin sform := controlForm; with Screen.Forms[ff] do begin for ii := 0 to componentcount - 1 do if Components[ii].Name = ControlName then begin sControl := controlName + ' comps ' + ii.ToString; Control := Components[ii] as Tcontrol; //onBS(False, format('Item %d Found %s',[ii,controlName])); break; end //else//if name //run := false; // onBS(False, format('Item %d not found %s',[ii, controlName])); end;// with screen forms end; //if screen.forms onBS(False, sForm + ' ' + sControl); end;// else end;//with taskdetail end; What TInstruction is TInstruction = class //position in Db Atom: PAtom; Control: TControl; ControlForm: string; //3 ControlName: string; //2 Description: string;//6 //Nu: integer; //0 Kind: string; //1 was integer KindNU: integer; referenceValue: Double;//5 tagName: string; //4 tagValue: Double; //no data in table end; -
Share a data between two units in dynamic loaded BPL.
Pat Foley replied to CRO_Tomislav's topic in VCL
One thing about XML is on a treeview each node needs a unique caption so as tabSheets or the parent of control wanted are added a number is added to the node's caption as the forms are added. Second thing is the Control could have data reference added. type // On the UI controls side carry some data references for convenience // the data side could use Dependance Injection to tie in UI controls TDataButton = class(TButton) Form: TControl; Strs: TStrings; end; What's neat about MDI you can create a new childform inside a begin..end. To access the form elsewhere use Application.Screen -
Retrieving outlook contact emails
Pat Foley replied to Connie McBride's topic in Algorithms, Data Structures and Class Design
I used the code for reverse phone lookup that's for an xxx with xx,xxx outlook accounts. You need to make a custom list of clients, a Client group email and ... then as employees come and go you add remove their access to the companies Client email account. Or you could enhance your application by logging when clients are added, contacted, removed from client list. I sent out emails and SMS each week to departments as client schedules were updated. -
Retrieving outlook contact emails
Pat Foley replied to Connie McBride's topic in Algorithms, Data Structures and Class Design
Again I would use OutLook to make the output using export. example mapping https://jkp-ads.com/rdb/win/s1/outlook/mail.htm Also here is some old (2017) Excel code from Ron's earlier site Sub DemoAE() Dim colAL As Outlook.AddressLists Dim oAL As Outlook.AddressList Dim colAE As Outlook.AddressEntries Dim oAE As Outlook.AddressEntry Dim oExUser As Outlook.ExchangeUser Set colAL = Outlook.session.AddressLists '("Offline Global Address List") For Each oAL In colAL 'Address list is an Exchange Global Address List If oAL.AddressListType = olExchangeGlobalAddressList Then Set colAE = oAL.AddressEntries For Each oAE In colAE If oAE.AddressEntryUserType = _ olExchangeUserAddressEntry _ Or oAE.AddressEntryUserType = _ olExchangeRemoteUserAddressEntry Then Set oExUser = oAE.GetExchangeUser ' Debug.Print (oExUser.JobTitle) ' Debug.Print (oExUser.OfficeLocation) ' Debug.Print (oExUser.BusinessTelephoneNumber) ' Range("A1").Offset(X, 1) = oExUser.JobTitle Range("A1").Offset(X, 9) = oExUser.ID 'OfficeLocation Range("A1").Offset(X, 8) = oExUser.MobileTelephoneNumber 'HomeTelephoneNumber Range("A1").Offset(X, 7) = oExUser.Name 'Range("A1").Offset(X, 5) = oExUser.PrimarySmtpAddress X = X + 1 End If Next End If Next End Sub