PiedSoftware
Members-
Content Count
54 -
Joined
-
Last visited
Everything posted by PiedSoftware
-
Can Delphi set session data in opening a webpage?
PiedSoftware posted a topic in Network, Cloud and Web
Hi This is a preliminary question. We have some functionality on the web and want to be able to set log-on to the web page from the Delphi app, without the log-in credentials being stored by the browser app. Any idea? -
Can Delphi set session data in opening a webpage?
PiedSoftware replied to PiedSoftware's topic in Network, Cloud and Web
Thanks, microtronix. Are you saying that from Delphi you can open a web page with cookies set in the code, and those cookies are not stored on the filesystem of the client? -
Any way to get RTTI for non-zero-based enumerated types?
PiedSoftware posted a topic in RTL and Delphi Object Pascal
Hi I have been using a generic record to convert combo-boxes to enumerated type. But Delphi spits the dummy if the type has any numbers specified. For example with this code the compiler throws up the error message "E2134 Type 'TDDArrangementId' has no type info. In the generic type TypeInfo(T) returns nil. type TDDArrangementId = (daOutstanding = 1, daWeeklyGap, daAmount, daGapAmount); ... procedure Test; var ti: PTypeInfo; begin ti := TypeInfo(TDDArrangementId); But removing the " = 1" makes it all build and run just fine. Can anyone confirm that Delphi's rtti system simply does not handle enumerated types if they are not zero-based? I'm using 10.4 --- Mark -
Any way to get RTTI for non-zero-based enumerated types?
PiedSoftware replied to PiedSoftware's topic in RTL and Delphi Object Pascal
Thanks. That would be useful. I have decided to do it differently in this case -
Any way to get RTTI for non-zero-based enumerated types?
PiedSoftware replied to PiedSoftware's topic in RTL and Delphi Object Pascal
The values correspond with values on a database. -
Hi We are having trouble with the Indy email components. They don't seem to work well with current email systems. We are getting failures, and false negatives resulting in multiple copies being sent. Can anyone recommend a good replacement library? Or give better advice? Regards Mark
-
Sorry I can't be more specific. The problem is in production and I just do development from home. The problems are not consistent either. It's a bit frustrating.
-
Hi With TListBox and TComboBox, if you set ItemIndex to -1, nothing is selected. I tried setting DrawGrid.Row := -1 but that gives an error. Is there some other way to show nothing selected yet?
-
Thanks, that is the way I went and it had the desired effect on the appearance. At first I tried to use a constant: const EmptyRect: TGridRect = (Left: -1; Top: -1; Right: -1; Bottom: -1); // Copied from implementation of vcl.grids procedure TGridDataRtti<T>.PopulateGrid(...); begin ... grid.Selection := EmptyRect; end; But that gave me the spurious error message: E2506 Method of parameterized type declared in interface section must not use local symbol 'EmptyRect'
-
There are some default things set, like font colour and background colour, and I am trying to stay as close to the defaults as I can,
-
There are some default things set, like font colour and background colour, and I am trying to stay as close to the defaults as I can,
-
Has anyone been able to get the Color TJvSpeedItem to work correctly on TFrame?
PiedSoftware posted a topic in General Help
I am trying to get a reusable TFrame working to use in a number of places in our app to let the users edit and format text in a TJvRichEdit. It consists of a TJvRichEdit and a TJvSpeedBar. The JEDI example code works, and I have copied and pasted the relevant form into the test project where I am developing this frame. But there is a problem in the frame: the colour buttons (Color and Background), which drop down lists of colours in the sample code and change the colour of the text, don't display correctly in the frame. They appear full length but empty, although selecting an item does change the colour of the text. In contrast the Underline button has a drop down list that looks and works fine in my code. The code is essntially the same. I'm initializing the menus in the form's OnShow event, whereas the JEDI sample does it in the form's OnCreaate. There's some strange behaviour in Delphi. If I bring up the Speedbar Designer and select the Color buttons, the list that appears in the Events tab is slightly different between the sample form and my frame, even though they should be the same. In the one that works there is a line for DropDownMenu, with the red font for properties that show up on the events tab. That line is absent from the correpsonding place in my frame. That line does show up for the buttons where the DropDownMenu is nil though. Curious. I'm using Delphi 10.1 Berlin and JCL version 3.50. JvRichEditToolBar.7z -
Has anyone been able to get the Color TJvSpeedItem to work correctly on TFrame?
PiedSoftware replied to PiedSoftware's topic in General Help
Ah, thanks! I missed those two lines. I just added the 2 lines you highlighted into the constructor of my frame, and it worked ColorMenu.ItemPainter := TJvXPColorMenuItemPainter.Create(Self); BackgroundMenu.ItemPainter := TJvXPColorMenuItemPainter.Create(Self); "You set the ColorMenu.Style to msOwnerDraw but then you don't implement the OnDrawItem and OnMeasureItem." That was not it. -
Has anyone been able to get the Color TJvSpeedItem to work correctly on TFrame?
PiedSoftware replied to PiedSoftware's topic in General Help
I have just installed 10.4 Sydney. The problem of the improperly formed colour menus is happening in 10.4 as well. -
Hi We has a library for generating Nevrona reports from script files that we right. The main function we use for outputting data in text form to the report is TBaseReport.PrintLeft. When a string with HTML for formating is passed to that function, the formating is all stripped out and the bare text is displayed. Is there a way to display text using any HTML formating? TIA Mark
-
Has anyone been able to get the Color TJvSpeedItem to work correctly on TFrame?
PiedSoftware replied to PiedSoftware's topic in General Help
Thanks, emailx45. I have posted an archive as an attachment to the opening post. It is the pas, dfm and dpr / drpoj files. It should be self explanatory. Of course it may be a bug that is fixed in later versions of Delphi and/or JVCL. Update: I have just added a pair of screenshots to show the correct look of the menu from the sample code and the incorrect look from my code. -
Hi Does anyone have any working example code for implementing a spell checker? I tried this https://www.thoughtco.com/spell-checking-from-delphi-code-1058149 but it doesn't compile, giving lots of Undeclared identifier errors.
-
Are you using the OnUpdate events of the individual actions? If so, IIRC, that only gets called if there is a control attached to the action and that control is visible.
-
Why is an enumerated type requiring the type name before the constants?
PiedSoftware posted a topic in Delphi IDE and APIs
Hi, I was surprised when a simple bit of code did not compile for me. I am using Delphi 10.1, and TEditCharCase is defined in System.UITypes thus: TEditCharCase = (ecNormal, ecUpperCase, ecLowerCase); I have a property of that type in a class TMapItem declared thus: property CharCase: TEditCharCase read fCharCase write fCharCase; Control clicking on TEditCharCase takes me straight to that line in UITypes. But when I wrote this innocent looking code: case mapItem.CharCase of ecNormal: expr := value; ecUpperCase: expr := value.ToUpper; ecLowerCase: expr := value.ToLower; end; it refused to compile, saying "E2003 Undeclared identifier: 'ecLowerCase'", etc for the 3 enumerated constants. But I got it to compile by prefixing the constants with the type name, thus: case mapItem.CharCase of TEditCharCase.ecNormal: expr := value; TEditCharCase.ecUpperCase: expr := value.ToUpper; TEditCharCase.ecLowerCase: expr := value.ToLower; end; This is strange. There are lots of places of enumerated types that don't need to have the type prefixed. Can anyone explain this? TIA Mark Patterson -
Why is an enumerated type requiring the type name before the constants?
PiedSoftware replied to PiedSoftware's topic in Delphi IDE and APIs
I noticed in the library source code that some of the uses of TEditCharChase constants were not prefixed with the type. For example, in DbCtrls there is this: case CharCase of ecUpperCase: S := AnsiUpperCase(S); ecLowerCase: S := AnsiLowerCase(S); end; When you ctrl-click the constants there you are sent to a line in StdCtrls that is part of this sequence of declarations: const { Editors common support } ecNormal = System.UITypes.TEditCharCase.ecNormal; ecUpperCase = System.UITypes.TEditCharCase.ecUpperCase; ecLowerCase = System.UITypes.TEditCharCase.ecLowerCase; type TEditCharCase = System.UITypes.TEditCharCase; So, some people seem to want to work around the SCOPEDENUMS. -
Why is an enumerated type requiring the type name before the constants?
PiedSoftware replied to PiedSoftware's topic in Delphi IDE and APIs
Thanks, David. I had a look at the code of UITypes.pas, and there at the top, as brazen as anything, is {$SCOPEDENUMS ON} I learned something new. And only been doing Delphi since 1995. -
Hi I have a TScrollBox that I am placing a number of "Cards" that are TFrame subclasses onto. As the number of cards increases, the performance of loading the list of cards initially is getting too long. Is there a way to delay loading these cards until they are scrolled into view? i.e. is there a way to trap the event of a card being shown in the scroll box?
-
How to detect when control is scrolled into view
PiedSoftware replied to PiedSoftware's topic in VCL
Thanks Lars. I did actually try out a background thread, running the query, then creating the cards and populating them, but it didn't look good. The scroll bar and its contents remained inaccessible until the whole process had finished for some reason. But the 2 changes I ended up making, i.e. removing the override of SetBounds (which was to help with formating) and adding the override of PaintWindow, see above, has brought the speed of loading a couple of hundred to a reasonable value. -
How to detect when control is scrolled into view
PiedSoftware replied to PiedSoftware's topic in VCL
I have implemented Anders Melander's idea, and it works well. Part of the trick of getting it to work was that I needed to invalidate the cards explicitly to ensure that PaintWindow got called and that the Load method was called. Which was obvious, eventually. Here is the guts of the code that makes it work, from the abstract superclass of the cards: procedure TDBCard.SetKey(const Value: variant); begin fKey := Value; loaded := false; Invalidate; // Force call to Load in PaintWindow if card on screen end{ SetKey}; procedure TDBCard.PaintWindow(DC: HDC); begin inherited; if not loaded then begin loaded := true; list.DataQuery.Locate(list.KeyFieldName, key, []); Load(list.DataQuery); Color := list.CardColour(self, false); end{if}; end{ PaintWindow}; -
How to detect when control is scrolled into view
PiedSoftware replied to PiedSoftware's topic in VCL
Thanks, Fr0sT.Brutal. We are using TJvTreeView and TTreeView in the project already, so if the current line I am following doesn't help, I will look into that.