DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Looking for Component to Fill Boxes  (Read 6,858 times)

Renegade

  • Tell me something you don't know...
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
    • Participated in NANY Challenge Three Times
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Looking for Component to Fill Boxes
« on: June 02, 2011, 01:39 PM »
Does anyone know of a component or source code that can do something like WinDirStat?

[attachimg=#]

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,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: Looking for Component to Fill Boxes
« Reply #1 on: June 02, 2011, 04:53 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.

Renegade

  • Tell me something you don't know...
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
    • Participated in NANY Challenge Three Times
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Looking for Component to Fill Boxes
« Reply #2 on: June 02, 2011, 05: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,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: Looking for Component to Fill Boxes
« Reply #3 on: June 02, 2011, 06:32 PM »
You already have it, but it's called WPF...
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

Renegade

  • Tell me something you don't know...
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
    • Participated in NANY Challenge Three Times
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Looking for Component to Fill Boxes
« Reply #4 on: June 03, 2011, 02:28 AM »
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

  • Fettucini alfredo is macaroni & cheese for adults
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,061
    • Linux User
    • Military Service Badge - US Air Force
Re: Looking for Component to Fill Boxes
« Reply #5 on: June 03, 2011, 04:30 AM »
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: (generic)
square[][] = AddRectangle[10][10]                           //creates the field array 10 squares across in size

xloc = 0                                                    //initializes starting x position
yloc = 0                                                    //initializes starting y position

for (x = 0, x <= <xarraysize>, x++){                        //where <xarraysize> is the actual array size defined      
     for (y = 0, y <= <xarraysize>, y++) {                   
            square[x][y] = AddRectangle(10,10,xloc,yloc)    //where x & y are the array positions & (10,10,xloc,yloc) are the
                                                            //size of the individual squares and their position.
            xloc = xloc + 10                                //increments the xloc variable by the pixel size of the rectangle
            yloc = yloc +10                                 //increments the xloc variable by the pixel size of the rectangle
     }
}

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 03, 2011, 04:41 AM by steeladept »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: Looking for Component to Fill Boxes
« Reply #6 on: June 03, 2011, 12:51 PM »
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.
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

Original address: https://www.donationcoder.com/forum/index.php?topic=26932.0