-
Content Count
882 -
Joined
-
Last visited
-
Days Won
7
Everything posted by Stano
-
The dfm file is obviously annoyed by the manual intervention in its contents.
-
The data was written to me in dfm. Not now. I'm talking about writing at design time (ComponentEditor). I enter the data, compile it and (supposedly) writes the data. Gives me back the number of bytes I have tried all the methods listed here. With Writer I get after completing all the functions (3) There is no notification when using Stream. Does anyone have any type where the mistake is? procedure TjstVstDBNavigator.WriteCaptionAdded(Stream: TStream); begin var S: String := FCaptionsAdded.Text; var Len: Integer := Length(S); Stream.Write(Len, SizeOf(Integer)); if Len > 0 then Stream.Write(S[1], Len * SizeOf(Char)); // Stream.Write(PByte(@S[1])^, Len * SizeOf(Char)); end; procedure TjstVstDBNavigator.WriteShortCutAdded(Stream: TStream); begin var Count: Integer := FShortCutsAdded.Count; Stream.Write(Count, SizeOf(Integer)); for var SC: TShortCut in FShortCutsAdded do Stream.Write(SC, SizeOf(SC)); end; procedure TjstVstDBNavigator.WriterCaptionAdded(Writer: TWriter); begin Writer.WriteListBegin; try for var I := 0 to FCaptionsAdded.Count - 1 do Writer.WriteString(FCaptionsAdded[I]); finally Writer.WriteListEnd; end; end;
-
The dfm file is obviously annoyed by the manual intervention in its contents.
-
Of course. You have to put them in GROUP BY. No TDATE.
-
The error was in the file itself. I set him full access rights. Nothing. I created a new one. Both writing and reading work. I can debug it.
-
The error was in the file itself. I set him full access rights. Nothing. I created a new one. Both writing and reading work. I can debug it.
-
It is possible. I had a hidden error (out of range) that could have caused it. After removing it, I did not try published. Thanks to Uwe, I solved the problem immediately with Loaded.
-
I do not want to publish these properties. I have a ComponentEditor on them. Of course I can change that. I tried it. Write OK, loading failed! And that's a big problem.
-
KILLER PROJECT - RESUSCITATE MWA DB JPEG COMPONENT LIBRARY
Stano replied to Blavatsky's topic in Databases
I have never done it. But the procedure is clear: You will be browsing the directory For each image, you insert it into the BLOB using TStream from file On internet are examples of this. I don't know more Good luck -
KILLER PROJECT - RESUSCITATE MWA DB JPEG COMPONENT LIBRARY
Stano replied to Blavatsky's topic in Databases
Please use lowercase letters. That's how you yell at us. I hardly understand anything about it. I have a fundamental question: where are the jpegs stored? In DB as BLOB or on disk? This is where working with them comes from. I recommend deploying FireDAC. -
Well thank you. It makes sense.
-
I thought the problem was clear I can't read the data from dfm. That is all. To be sure, I enclosed the entire passport. Interesting are: FCaptionsAdded: TStrings; procedure ReadCaptionAdded(Reader: TReader); procedure WriteCaptionAdded(Writer: TWriter); procedure TjstVstDBNavigator.WriteCaptionAdded(Writer: TWriter); begin Writer.WriteListBegin; try for var I := 0 to FCaptionsAdded.Count - 1 do Writer.WriteString(FCaptionsAdded[I]); finally Writer.WriteListEnd; end; end; procedure TjstVstDBNavigator.ReadCaptionAdded(Reader: TReader); var Len: Integer; begin ShowMessage('ReadCaptionAdded'); // I won't get here end; jstVstDBNavigator.pas MainForm.dfm MainForm.pas
-
KILLER PROJECT - RESUSCITATE MWA DB JPEG COMPONENT LIBRARY
Stano replied to Blavatsky's topic in Databases
I'm using google translate. The result is appalling. To the problem: it is on the db where to store the record. You must don't care! You must secure the order in Query using ORDER BY. Not different. -
Custom Component: to create an event for a field of type TBaseVirtualTree
Stano posted a topic in VCL
My component contains the field FVirtualTree: TBaseVirtualTree; FVirtualTree is not a subcomponent. There are examples of this. Assigned during design. I need to write an OnChange event for FVirtualTree in the component. It should work like this When writing a component: for FVirtualTree I will create OnChange. I'll write my code At design runtime Assign to component (property VirtualTree) Vst1 (TVirtualStringTree) For Vst1 I define the OnChange event During the runtime I change the node - it calls Vst1.OnChange I'll do something there I call FVirtualTree.OnChange Vst1.OnChange completes I did not find anything about such a case. -
Custom Component: to create an event for a field of type TBaseVirtualTree
Stano replied to Stano's topic in VCL
I gave up the original idea. What I asked here. -
Custom Component: to create an event for a field of type TBaseVirtualTree
Stano replied to Stano's topic in VCL
You brought me the following solution, which I originally rejected. That's not how I imagined it. It's the easiest. Thanks! procedure TfrmMainForm.jstvst1Change(Sender: TBaseVirtualTree; Node: PVirtualNode); var NodeData: PAddress; begin if not Assigned(Node) then Exit; NodeData := jstvst1.GetNodeData(Node); jstnav1.PKeyValue := NodeData.PKey; jstnav1.VirtualTreeChange(Sender, Node); // I thought he would be inherited here -
Custom Component: to create an event for a field of type TBaseVirtualTree
Stano replied to Stano's topic in VCL
Unfortunately, it's not good. It behaves as if I simply / directly assigned the event to VST. It means: the TjstVstDBNavigator.VirtualTreeChange procedure is called (Sender: TBaseVirtualTree; Node: PVirtualNode); MyVst.OnChange is NOT called -
Custom Component: to create an event for a field of type TBaseVirtualTree
Stano replied to Stano's topic in VCL
Looks like yes. I'll try and let you know. -
I guess he meant TVirtualImage instead of TVirtualImageList. OT because I wrote about image quality. Not about the subject of the question. Uwe is right. I did it with ActionToolBar. I didn't realize the difference.
-
OT: I recommend using TImageCollection and TVirtualImageList. This significantly increases the quality of the images. I don't know if the problem will solve it.
-
Hi, I want to create a component based on TActionToolBar. I want to dynamically create a TActionManager in it. TActionManager to populate TAction. I have this code procedure TjstVstDBNavigator.NewActions; var ItemIndex: Cardinal; ActionBarItem: TActionBarItem; ActionClientItem: TActionClientItem; begin // My code if Assigned(FAcnMan) then FreeAndNil(FAcnMan); FAcnMan := TAcTionManager.Create(Self); FAcnMan.SetSubComponent(True); Self.ActionManager := FAcnMan; FActions.Clear; // Copied code ActionBarItem := FAcnMan.ActionBars.Add; for var IdxActn in FRequiredIdxActn do begin ItemIndex := Ord(TIndexAction(IdxActn)); // Create new action for a menu/ActionToolBar item FActions.Add(TAction.Create(Self)); FActions.Last.Category := 'PopupMenuItems'; .... // Add this action to the Action Manager FActions.Last.ActionList := FAcnMan; // Also add this action to the Action Bar ??? actionClientItem := ActionBarItem.Items.Add; actionClientItem.Action := FActions.Last; end; // My code Self.ActionClient := FAcnMan.ActionBars[0]; end; The buttons are displayed. But only Caption. I want to set the TAction properties as follows (copied from Embt): procedure TjstVstDBNavigator.ApplyShowOnAction; const NoActionToolBar = -1; var Action: TAction; BarItem: TActionBarItem; Client: TActionClientItem; K: Integer; begin for var J := 0 to FAcnMan.ActionBars.Count -1 do // OK begin BarItem := FAcnMan.ActionBars.ActionBars[J]; // I'm done here if BarItem.ActionBar <> nil then begin for K := 0 to BarItem.Items.Count -1 do begin Client := BarItem.Items[K]; if Client.Action <> nil then begin Action := (Client.Action as TAction); if Action <> nil then begin Client.ShowShortCut ...; ... end; I don't have the whole structure in ActionManager. The figure shows the structure created by the ActionManager. I need that. I have no idea how to do it.
-
The solution, as always, is simple: FAcnMan.ActionBars[0].ActionBar := Self; /// - TActionToolBar
-
Delphi 11.1 IDE - Control + Click doesn't open FireDAC units
Stano replied to Michael Riley's topic in Delphi IDE and APIs
Unfortunately not at all. Professional does not contain FireDAC files! -
The problem is gone. Don't know why / how yet. Keep the topic closed.