Jump to content

Stano

Members
  • Content Count

    882
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Stano

  1. Stano

    Loading data from dfm

    The dfm file is obviously annoyed by the manual intervention in its contents.
  2. Stano

    Write data to dfm

    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;
  3. Stano

    Write data to dfm

    The dfm file is obviously annoyed by the manual intervention in its contents.
  4. Stano

    FB-3 SQL ROWS

    Of course. You have to put them in GROUP BY. No TDATE.
  5. Stano

    Write data to dfm

    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.
  6. Stano

    Loading data from dfm

    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.
  7. Stano

    FB-3 SQL ROWS

    MAX(TDATE)
  8. Stano

    Loading data from dfm

    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.
  9. Stano

    Loading data from dfm

    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.
  10. 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
  11. 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.
  12. Stano

    Loading data from dfm

    Well thank you. It makes sense.
  13. Stano

    Loading data from dfm

    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
  14. 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.
  15. 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.
  16. I gave up the original idea. What I asked here.
  17. 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
  18. 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
  19. Looks like yes. I'll try and let you know.
  20. Stano

    TImage (JPG) not scaling, but PNG and BMP DO ???

    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.
  21. Stano

    TImage (JPG) not scaling, but PNG and BMP DO ???

    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.
  22. 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.
  23. Stano

    Dynamic creation of TActionManager with Actions

    The solution, as always, is simple: FAcnMan.ActionBars[0].ActionBar := Self; /// - TActionToolBar
  24. Unfortunately not at all. Professional does not contain FireDAC files!
  25. Stano

    Dynamic creation of TActionManager with Actions

    The problem is gone. Don't know why / how yet. Keep the topic closed.
×