Jump to content


Photo

Autofit-Option: Resize Column Height


  • Please log in to reply
37 replies to this topic

#1 karl

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

Posted 25 November 2015 - 07:42 PM

Hi,

I recently bought a copy of your components and now I have a few questions:

 

1.) In NxGrid6 if I enable the autofit option the column height is not adjusted on resize. However if I edit a cell, after editing it the column height is adjusted correctly.

     Is there a way to trigger the colum height resizing on resize?

 

2.) Also I would like to resize a column to fit the text the user typed into it (triggered after editing is finished). How can this be accomplished ?

 

3.) I noticed that if i resize my form, the font size of NxInspector6 stays the same. Is there a way to make it scale like NxGrid6 with auto fitting enabled ?



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 25 November 2015 - 08:56 PM

Hi,

 

1 & 2) I think that you can do a lot with FitOptions property. There you can adjust what will be auto-fit (row, column or both).

 

I think that now I will add OnResize event to column so you will be able (will update tomorrow) to call BestFitCol or BestFitRow manually.

 

3) There are ParentCaptionFont and ParentValueFont. I will double check them to see if there is some bug.

 

Best regards


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.

#3 karl

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

Posted 25 November 2015 - 09:20 PM

Thank you for the prompt response.

 

@ 1) I tried setting nxtgrd.FitOptions := [foColumn,foRow] in the onCreate event of my form, but it did not change anything.

 

@ 2) Thank you for your effort, I will check that out tomorrow.

 

@3) Thanks.

 

Btw I'm using xe10 on win10.

 

Regards, Karl

 

 

            



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 25 November 2015 - 09:57 PM

Hi,

FitOptions is working after values is changed. I added OnResize and in tomorrow's update call BestFitCol/Row inside this event.
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.

#5 karl

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

Posted 26 November 2015 - 01:14 AM

Thank you, I will try it when it's out.

 

One more thing despite NextInspector not changing the font after resizing the form,

 

the headers of NextGrid6Columns also don't change their font (I got parent font set to true).

 

Maybe you could check that too.

 

Regards, Karl.



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 26 November 2015 - 11:44 AM

Hi Karl,

 

Can you please tell me more about what you thing with "resizing form". Do you think about Font resizing, or resizing rect of form?


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.

#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 26 November 2015 - 12:23 PM

Hi Karl,

 

I have uploaded new update. Now you can see OnResize event for column. If you need, I will add to NextGrid OnResizeColumn event (where Index will be).

 

Please rebuild all packages (since OnResize need to be visible in design-time), just open groupproj file and Build All Projects from menu.


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.

#8 karl

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

Posted 26 November 2015 - 03:00 PM

Hi Karl,

 

Can you please tell me more about what you thing with "resizing form". Do you think about Font resizing, or resizing rect of form?

Hi Boki,

 

I'm using form.scaleby().

 

I will check your update later in the afternoon, thank you



#9 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 26 November 2015 - 03:21 PM

Hi Karl,

I never used this technique before. Can you maybe send me short demo project to see how you do it.
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.

#10 karl

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

Posted 26 November 2015 - 03:38 PM

Hi Boki,

 

I'll upload a sample project shortly to better illustrate what I'm trying to do :)



#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 26 November 2015 - 03:44 PM

Thanks! You can upload it here, or send it to my mail.
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.

#12 karl

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

Posted 26 November 2015 - 04:56 PM

Hi Boki,

I attached the sample.

Didn't check your update yet becouse I'm having some problems reiinstalling.
I'm going to try again and report back..

#13 karl

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

Posted 26 November 2015 - 04:57 PM



#14 karl

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

Posted 26 November 2015 - 07:09 PM

Hi Boki,

I managed to reinstall your component(with your new update, thank you for that), so I added another sample, showing

how I resize a form with nextgrid6 and nextinspector6.

As you can see scaling the grid correctly does work now :).
But I have 1 more question, how do i fit the number column correctly?

Also, as I stated in an earlier post, NextInspector doesn't change it's font after using scaleby (you can see that in my sample),

I hope this helps you fixing it.

Attached File  sample2.zip   72.2KB   3 downloads
(I Deleted the exe becouse it was to large..)

Regards, Karl.

#15 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 26 November 2015 - 10:51 PM

Thanks Karl,

 

I will test your demo to see this concept and what we can do. I hope that I will be back 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.

#16 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 27 November 2015 - 12:47 AM

Hi Karl,

 

I see now how you did it. I will work to solve font issue tomorrow.

 

For auto-size column, best practice is to set width of all columns first. Then, set AutoSize to True. AutoSize still require some polishing.


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.

#17 karl

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

Posted 27 November 2015 - 02:23 PM

Hi Karl,

 

I see now how you did it. I will work to solve font issue tomorrow.

 

For auto-size column, best practice is to set width of all columns first. Then, set AutoSize to True. AutoSize still require some polishing.

Hi Boki,

 

thank you for the great support :), now it works fine.

 

Please keep me posted on your progress regarding the font issue.

 

Regards, Karl



#18 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 27 November 2015 - 02:39 PM

Hi Karl,

 

I think that I have fixed Font issue for NextInspector. You can download new update now.

 

You can simply replace Sources sub-folder and it should work after you run your project.

 

Best regards


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.

#19 karl

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

Posted 27 November 2015 - 03:22 PM

Hi Boki,

 

I tested your update and the font does indeed work fine now, thank you.

 

However, if I resize the form now, the font size changes, but the node row width / height of NextInspector stays the same.

 

Is there some way to adjust it according to the font size, just like bestFitCol/Row in NextGrid?

 

I tried setting the autosize property to true but this results in an access violation.

 

Regards, Karl 



#20 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 27 November 2015 - 04:17 PM

Hm, I will try to think what to do in this situation.

 

There is a BestFit method for node too. Maybe you can find it useful? It measure Font and update Height of node.


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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users