Mike Torrettinni
Members-
Content Count
1509 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Mike Torrettinni
-
Why control methods (OnClick) can't be defined in Form Private section?
Mike Torrettinni replied to Mike Torrettinni's topic in VCL
Hm... then why I get same message if I run Project1.exe, without IDE? I get same error message. So, if I move button1 and Button1Click to Private, IDE doesn't complain. I can still modify control. Compiles OK also. -
Can GExperts format multiline method definition to single line?
Mike Torrettinni posted a topic in GExperts
Can GExperts reformat this: procedure VirtualStringTree1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: string); into single line: procedure VirtualStringTree1GetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: string); In definition and/or in implementation. I think single line is much more readable, when it's a long unit with lots of methods. -
UltraCode64 for Delphi (aka 64-bit FastCode)
Mike Torrettinni replied to chmichael's topic in RTL and Delphi Object Pascal
I have a plan to start with 64bit development in a few months, so I will definitely be available to contribute with testing, bench marking, if needed. -
Can GExperts format multiline method definition to single line?
Mike Torrettinni replied to Mike Torrettinni's topic in GExperts
Thanks, I think I have enough to work with, for now. -
Can GExperts format multiline method definition to single line?
Mike Torrettinni replied to Mike Torrettinni's topic in GExperts
It works! I closed and re-opened Delphi, now CTRL+E shows Edit procedure dialog, before it didn't. And just pressing Enter, it reformats definition for that method. Great, thanks! Any way to reformat the whole existing unit at once? -
Can GExperts format multiline method definition to single line?
Mike Torrettinni replied to Mike Torrettinni's topic in GExperts
Aha, it works on new methods - adding new method will be a 1 line definition, when double clicking method in Object inspector. It doesn't convert old/existing methods. I have D 10.2.3 and MMX 14.0.5 build 2276 -
Can GExperts format multiline method definition to single line?
Mike Torrettinni replied to Mike Torrettinni's topic in GExperts
Wrap margin is set to 500. but still it doesn't work - or, I don't know how to use it properly. No matter where my focus is, CTRL+E does not do anything. I even tried selecting the method and CTRL+E and nothing. -
Can GExperts format multiline method definition to single line?
Mike Torrettinni replied to Mike Torrettinni's topic in GExperts
I do use MMX, well just started. I set right margin high (500). I tried, but I can reproduce the behavior you are describing with CTRL+E, Enter... where exactly should my cursor be to press CTRL+E and then Enter, in code, in MMX? -
How do you organize units, forms?
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
When I open a unit or form after a while, I go for FormCreate and FormShow first, to see what is part of initialization and visual setup. So, I like to know these methods are at the top. -
How do you organize units, forms?
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
I just started looking into MMX for cyclic usage, not for anything else. I only use Structure view for Forms, not for code... interesting, will give it a try. Thanks for the tip! -
I used Delphi 7 for a long time and have very fond memories, until upgraded to D2006 - which I had to restart once a day, when project grew, as IDE used so much memory. Crazy. Then upgraded to XE7, which was good, but code completion and error insight were broken, badly. Now in 10.2.3 it's a little better than XE7, but still probably years away from stable code completion and error insight. But, I did have to use D2006 a few months back and the speed of IDE compared to 10.2.3 is like night and day, D2006 is so much faster, everything is instant, opening files, forms, menus, debugging... while in 10.2.3 everything has a little delay, noticeably slower. Of course I prefer 10.2.3, which includes generics and all other improvements. I would be OK with even slower IDE to get working code completion and error insight. If it's the size of project that affects code completion and error insight then OK, let it be slow... but make it work without failing.
-
Marking of the main form in a multiform VCL Application
Mike Torrettinni replied to PeterPanettone's topic in Delphi IDE and APIs
Thanks, will look into MMX. I guess a thread like you propose would be better suited for that, as I can get carried away, sometimes 😉 -
Marking of the main form in a multiform VCL Application
Mike Torrettinni replied to PeterPanettone's topic in Delphi IDE and APIs
Yes, I do use the Structure view. What I meant was to be able to have a quick preview of classes in the units, in the Project manager. -
Marking of the main form in a multiform VCL Application
Mike Torrettinni replied to PeterPanettone's topic in Delphi IDE and APIs
I very rarely use that view to open units, even when working on projects I'm not familiar with, I usually follow the code. It would be nice to have more detailed/advanced view, like all classes defined in each unit or similar. I would also use it more if it had more dynamic search where I enter few characters like 'cust' and would filter to a list of units that contain 'cust' in name (looking for Customer related units), like Cust* , *cust*.. and so on. That would be very useful. -
autosize columns in VirtualStringTree in grid mode
Mike Torrettinni replied to dummzeuch's topic in VCL
I customized function TBaseVirtualTree.GetMaxColumnWidth that is used in AutoFitColumns - what I use to autosize columns: // start with Column Caption width if FHeader.FColumns[Column].Text <> '' then begin GetTextExtentPoint32W(Canvas.Handle, PWideChar(FHeader.FColumns[Column].Text), Length(FHeader.FColumns[Column].Text), vSize); Result := vSize.cx + 20; // Margin end; Which takes into account the Column caption and adds it to the starting Result value, before it gets to calculating column width based on text. I put it before this line: while Assigned(Run) and not OperationCanceled do Works good for my usage. -
What about "Lifetime km/mi:" ?
-
Should I keep class alive (global) or not?
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
@Stefan Glienke What would be your suggestion on my original question, how to keep data alive - to keep the class alive or store important data from class and free the class? -
Should I keep class alive (global) or not?
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Thank you, interesting. And this is singleton, right? -
Should I keep class alive (global) or not?
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Ok, lets assume we call method/property SetData1to set Data1 value... then how do I access same Data1 value from Main Form and Check form? Do I need to use someLocalVar := TDataStore.Data1everywhere or is someLocalVar actually global variable, gGlobalDataStore? -
Should I keep class alive (global) or not?
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Aha, I thought singleton is just 'then way you use class' thing. I use records for what you described above - a data container (global variable) without needed for creating an instance, while classes are used with .Create, so I guess this means I always uses classes as created instances. So, are you describing a record (with properties, methods...)? I need to access it from Main Form and Check form, and perhaps other units, too. -
One of the things that really annoy me is when applications don't allow me quick access to the file I just saved/exported/created/generated/print to pdf... Examples: Save attachment from Outlook, Save as in Word, Excel - in these cases and many more you need to manually go and locate the file you just saved. Annoying. I'm thinking of redesigning my message for any file created with my application. Right now I have a few different messages using ShowMessage, like 'Action executed.', 'Done', 'File saved.', 'File copied', 'Project summary saved as PDF.' and others - all related to files begin saved - a mess. I'm thinking of having a new message form with button 'Locate file' so that any file generated from my application is accessible right away. How do others deal with this? I'm interested in any suggestions on design, maybe extending my initial idea to something even more useful. Thanks!
-
Good design for "file was just saved" message
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
I have a combination of menus, context menus and also simple TButtons that do the Export/Save as... not sure how I can implement this easily. If you have an example of any other app, where I can see the design of this (even googling the image, screenshot should be fine), would be nice to see. -
Good design for "file was just saved" message
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
Good advice for 'application log', will think about it. Right now I have 'recent files' for importing into the project, while content is completely different than the report files, so I will see if my imagination can put these two together and present as a general entry log. So, a question for you: I assume you would use 'Do not show message when creating files' checkbox, when it first pops-up, knowing you can access any report file through another way, like 'View all created files' option? -
Good design for "file was just saved" message
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
Thank you, for now I already have a form for this. If I need something similar in the future, will look into this. At the beginning I didn't know how the design will be, what I will need to show, so it was easier to design a form and see the controls. -
Good design for "file was just saved" message
Mike Torrettinni replied to Mike Torrettinni's topic in General Help
OK, I went a little overboard with options... but it's still in design mode: