topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 3:32 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Looking for Component to Fill Boxes  (Read 4556 times)

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,288
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Looking for Component to Fill Boxes
« on: June 02, 2011, 08:39 AM »
Does anyone know of a component or source code that can do something like WinDirStat?

Screenshot - 6_2_2011 , 11_33_16 PM.png

I just want to be able to fill a rectangle with rectangles. I'll only need to be able to place about 100 or so. Maybe a couple hundred. Not the thousands like WinDirStat.

The filler rectangles will be of a fixed size, and usually in the order of 4x1 to 8x1.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,646
    • View Profile
    • Donate to Member
Re: Looking for Component to Fill Boxes
« Reply #1 on: June 02, 2011, 11:53 AM »
Not sure if it helps, but SpaceSniffer is the same type of application, and has the same type of control. It looks to be a pure Win32 API Delphi application.

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,288
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: Looking for Component to Fill Boxes
« Reply #2 on: June 02, 2011, 12:10 PM »
Not sure if it helps, but SpaceSniffer is the same type of application, and has the same type of control. It looks to be a pure Win32 API Delphi application.

Not what I'm looking for. I want to find a component that will let me fill a rectangle with rectangles that I define. But the idea is the same as WinDirStat. They just use shaded rectangles. I want to so something different in there.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,612
    • View Profile
    • Donate to Member
Re: Looking for Component to Fill Boxes
« Reply #3 on: June 02, 2011, 01:32 PM »
You already have it, but it's called WPF...

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,288
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: Looking for Component to Fill Boxes
« Reply #4 on: June 02, 2011, 09:28 PM »
You already have it, but it's called WPF...

How so? I'm not sure I'm following you.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

steeladept

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,061
    • View Profile
    • Donate to Member
Re: Looking for Component to Fill Boxes
« Reply #5 on: June 02, 2011, 11:30 PM »
I don't know of anything off hand, but it really should be quite simple to code.  I did something similar already with a transform to boot.  I can't find the code right now, but nesting squares within a square goes something like this:

Code: Text [Select]
  1. square[][] = AddRectangle[10][10]                           //creates the field array 10 squares across in size
  2.  
  3. xloc = 0                                                    //initializes starting x position
  4. yloc = 0                                                    //initializes starting y position
  5.  
  6. for (x = 0, x <= <xarraysize>, x++){                        //where <xarraysize> is the actual array size defined      
  7.      for (y = 0, y <= <xarraysize>, y++) {                  
  8.             square[x][y] = AddRectangle(10,10,xloc,yloc)    //where x & y are the array positions & (10,10,xloc,yloc) are the
  9.                                                             //size of the individual squares and their position.
  10.             xloc = xloc + 10                                //increments the xloc variable by the pixel size of the rectangle
  11.             yloc = yloc +10                                 //increments the xloc variable by the pixel size of the rectangle
  12.      }
  13. }

At least I think that is about what I did.  I will post it if I can find it.  It was originally written in SmallBasic just to prototype the logical concept.  I will be implementing it in Java, eventually for a personal project I have been working on for about 4 years now off and on (more off than on) to learn the language.

Note, if you want variable size internal squares, you can put a variable in in place of the 10's listed above and then just subtract the number of pixels left in the array.  It would, of course, require another variable or two to track the array size in pixels, but that should be trivial to add.
« Last Edit: June 02, 2011, 11:41 PM by steeladept »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,612
    • View Profile
    • Donate to Member
Re: Looking for Component to Fill Boxes
« Reply #6 on: June 03, 2011, 07:51 AM »
You already have it, but it's called WPF...

How so? I'm not sure I'm following you.

AFAIR you where coding in .NET earlier, and since 3.0 that comes with WPF. It's not that difficult to code that in C#/XAML, I'd have to start a small 'playing-man' project to come up with code, but time is a bit short ATM.