Unfortanetly, it doesn't work.
If I do this:
node.AutoSize := True;
or this:
node.BestFit;
I get an access violation.
Posted 27 November 2015 - 04:38 PM
Unfortanetly, it doesn't work.
If I do this:
node.AutoSize := True;
or this:
node.BestFit;
I get an access violation.
Posted 27 November 2015 - 05:33 PM
Posted 27 November 2015 - 06:00 PM
Hi Boki,
here's the sample you asked for: (accidentally uploaded the wrong sample, see below: 'working_sample' for the right one)
Uncomment the 2 lines in onCreate to see the access violation.
Edited by karl, 27 November 2015 - 07:10 PM.
Posted 27 November 2015 - 06:32 PM
Sorry, I think I uploaded the wrong file
Posted 27 November 2015 - 06:40 PM
thats the correct, unit and .dfm, sorry again
Posted 27 November 2015 - 11:16 PM
Thanks,
I hope that I will have fix for tomorrow.
Posted 28 November 2015 - 04:08 PM
Hi Karl,
I have found where problem was. BestFit fit only to Value, not Caption. I have changed this in new update (will be out today).
Then, with this new update you simply do this:
var i: Integer; begin (* resize form by 20% ctrl + and ctrl - *) if (Shift = [ssCtrl]) then begin if (fScaling>minScaling) and (Ord(Key) in [109,189]) then begin self.ScaleBy(10,12); dec(fScaling); end; if (fScaling<maxScaling) and (Ord(key) in [107,187]) then begin Self.ScaleBy(12,10); inc(fScaling); end; end; // nxnspctrnd.AutoSize := True; // --- new code --- for i := 0 to nxtnspctr.Nodes.Count - 1 do begin nxtnspctr.Nodes.Node[i].BestFit; end; end;
Posted 28 November 2015 - 04:10 PM
I have uploaded new update.
ps. I will be out for today, please sorry if I delay with answer.
Posted 28 November 2015 - 04:18 PM
Thanks Boki.
I will check it out.
Posted 28 November 2015 - 09:22 PM
Hi Boki,
I just tested your new version and the code you posted.
Calling bestfit or setting autosize to true in the KeyPress-Event works now,
but it only sets the correct node-height.
I would like to also set the nodes width to fit the text width of the nodes captions.
Is there a way to do this ?
Also setting: autoSize := true
in the nodes Editor still results the application no longer compiling.
Moreover running the code you posted( or setting node.Autosize := true; )
in the onCreate- or the onShow-Event of the form still results in an access violation.
Posted 28 November 2015 - 11:14 PM
Hi Karl,
1) I will need to add this feature, I think that it will be separated from BestFit of Node. I hope that I will add it in day. I think that it will be inside NextInspector.BestFitCaptions (or similar).
2) AutoSize I will check this.
Posted 29 November 2015 - 12:22 AM
Thank's Boki, please keep me posted.
Edit: Deleted my question, found out how to do it..
Posted 29 November 2015 - 05:18 AM
Hi Karl,
I am updating new developer section http://developer.bergsoft.net/ . It is still rough, but progressing.
I have near to finish BestFitCaptions for NextInspector. I hope that I will be able to upload it in Monday.
Posted 29 November 2015 - 05:45 PM
Posted 30 November 2015 - 03:09 PM
Hi Carl,
I will upload new build in hour or two.
There is now BestFitSplitter option for you. I have also enhanced BestFit for node, so you can now chose what to use for "fit" (Value, Caption or both).
I have fixed AV when you call BestFit in Create, but it need to be done better, since Canvas for View is set after Paint is called for first time. I think that I will set Canvas after ParentNode is set instead.
Posted 30 November 2015 - 03:50 PM
Thank's Boki ,
I'll check it out as soon as you upload it
Posted 30 November 2015 - 07:47 PM
Hi Boki,
BestFitSplitter works great, thank you
The access violations are also gone.
There's just one more thing. if I call bestFit in OnCreate or OnShow of the form, the node height isn't measured correctly.
Calling it in the keyPress-Event however works perfectly.
0 members, 1 guests, 0 anonymous users