Jump to content


Photo

Autofit-Option: Resize Column Height


  • Please log in to reply
37 replies to this topic

#21 karl

karl
  • Members
  • 52 posts
  • Gender:Male
  • Location:Austria

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.



#22 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 27 November 2015 - 05:33 PM

Hi Karl,

I will check it. If you have mini demo (updated project you sent to me) this can help.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#23 karl

karl
  • Members
  • 52 posts
  • Gender:Male
  • Location:Austria

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.


#24 karl

karl
  • Members
  • 52 posts
  • Gender:Male
  • Location:Austria

Posted 27 November 2015 - 06:32 PM

Sorry, I think I uploaded the wrong file



#25 karl

karl
  • Members
  • 52 posts
  • Gender:Male
  • Location:Austria

Posted 27 November 2015 - 06:40 PM

 

thats the correct, unit and .dfm, sorry again



#26 karl

karl
  • Members
  • 52 posts
  • Gender:Male
  • Location:Austria

Posted 27 November 2015 - 06:53 PM

Attached File  working_sample.zip   53.14KB   3 downloads

 

the whole project..

 



#27 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 27 November 2015 - 11:16 PM

Thanks,

 

I hope that I will have fix for tomorrow.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#28 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

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;

boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#29 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

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.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#30 karl

karl
  • Members
  • 52 posts
  • Gender:Male
  • Location:Austria

Posted 28 November 2015 - 04:18 PM

Thanks Boki.

 

I will check it out.



#31 karl

karl
  • Members
  • 52 posts
  • Gender:Male
  • Location:Austria

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.



#32 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

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. 


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#33 karl

karl
  • Members
  • 52 posts
  • Gender:Male
  • Location:Austria

Posted 29 November 2015 - 12:22 AM

Thank's Boki, please keep me posted.

 

Edit: Deleted my question, found out how to do it..



#34 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

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.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#35 karl

karl
  • Members
  • 52 posts
  • Gender:Male
  • Location:Austria

Posted 29 November 2015 - 05:45 PM

Thank's Boki, I will check it out when you upload it :)

#36 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

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.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#37 karl

karl
  • Members
  • 52 posts
  • Gender:Male
  • Location:Austria

Posted 30 November 2015 - 03:50 PM

Thank's Boki :) ,

I'll check it out as soon as you upload it



#38 karl

karl
  • Members
  • 52 posts
  • Gender:Male
  • Location:Austria

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.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users