Author Topic: Palette Problem  (Read 22819 times)

0 Members and 1 Guest are viewing this topic.

DBARANAS

  • Guest
Re: Palette Problem
« Reply #15 on: August 16, 2006, 11:07:33 PM »
I went to datagridviews and solved the problem. The ENTER key now works. I also struggled on how to show a grid by rows instead of collumns.

This is valuable if you want to display items in a row instead of scrolling across lots of collumns like the datadridview typically works. Everything on the forms is like this now..I had 400 controls and I replaced them all by putting them into 10 grids.

I searched for 2 weeks to find how to do this with a grid and then had to figure it out. I think this is a nice way to display things in a CAD app...here is what I did....

    Public Sub DVGTest()

        With dgvDebugList  'A datagridview on a form

            .ColumnCount = 11
            .RowCount = 100

            For Each column As DataGridViewColumn In dgvDebugList.Columns
                Select Case column.Index
                    Case 0
                        column.HeaderCell.Value = column.Index & "DVG Test"
                        column.SortMode = DataGridViewColumnSortMode.NotSortable
                End Select
            Next

            For Each row As DataGridViewRow In dgvDebugList.Rows
                Dim chk As DataGridViewCheckBoxCell = New DataGridViewCheckBoxCell()
                Dim txt As DataGridViewTextBoxCell = New DataGridViewTextBoxCell()
                Select Case row.Index
                    Case 0
                        row.HeaderCell.Value = "allowMakeBnd"
                        row.Cells(0) = txt : txt.Value = SetupItems.allowMakeBnd
                    Case 1
                        row.HeaderCell.Value = "bAutotests"
                        row.Cells(0) = chk : chk.Value = SetupItems.bAutotests
                    Case 2
                        row.HeaderCell.Value = "bBuildPreview"
                        row.Cells(0) = chk : chk.Value = SetupItems.bBuildPreview
                    Case 3
                        row.HeaderCell.Value = "bColor"
                        row.Cells(0) = chk : chk.Value = SetupItems.bColor
                    Case 4
                        row.HeaderCell.Value = "bDimension"
                End Select
            Next

            Me.Controls.Add(dgvDebugList)

        End With

    End Sub

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: Palette Problem
« Reply #16 on: August 16, 2006, 11:48:08 PM »
That looks good Dave, so I'd imagine it has scroll bars bottom and side?
Fair bit of data to deall with there also 1000 cells!
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.
- J.R.R. Tolkien

DBARANAS

  • Guest
Re: Palette Problem
« Reply #17 on: August 17, 2006, 12:17:33 AM »
Hi Mick,

yes it has all that!

I am very proud that I googled my brains out, never found an answer, then did it the hard way and came up with something perfect for me. Put this into a tool palette and I am well on my way to making a professional CAD app.

BTW I gave up on that idea of putting up tool palettes horizontally. I make tool pallettes on the left that I switch is the best way to make a GUI for CAD

I will post a better example if anyone wants it.

DBARANAS

  • Guest
Re: Palette Problem
« Reply #18 on: August 17, 2006, 12:26:46 AM »
Correction.

Although tha classes may have over 1000 properties, lots of them are array() properties.

They each get their own collumn, so the size rarely exceeds a rowcount of 100.

BTW that was my debug grid.

I use a combo to switch grids and it does the work with hardly a refresh delay

It works really well switching classes into grids.

The only reason I even do thiis is to trap errors....in VBA this was vet simple

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: Palette Problem
« Reply #19 on: August 17, 2006, 12:30:00 AM »
Nice job, very slick!
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.
- J.R.R. Tolkien

DBARANAS

  • Guest
Re: Palette Problem
« Reply #20 on: August 17, 2006, 12:37:29 AM »
Thanks Mick!

it is way too $$% Slick. I wish my programming ability was as slick as my ideas

90% of my efforts are figuring out a way to make code do what I want.

That one was a bitch....But I had to have it. Now that I have it everything else falls into place.

Dave


MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: Palette Problem
« Reply #21 on: August 17, 2006, 12:49:19 AM »
Quote
90% of my efforts are figuring out a way to make code do what I want.

If it was easy, everyone would be doing it :D
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.
- J.R.R. Tolkien

DBARANAS

  • Guest
Re: Palette Problem
« Reply #22 on: August 17, 2006, 12:56:43 AM »
Touche!!

You got a good point.

Otherwise I would "wind up working at a gas station" - Frank Zappa 1976





Glenn R

  • Guest
Re: Palette Problem
« Reply #23 on: August 17, 2006, 02:03:31 AM »
Very slick Dave - nice work. Did you consider using a "propertygrid"? I use these for configuration on a dialog (if it requires it) fired from a "settings" button. The beauty of them is that you can design a class, which needs certain attributes and tell the grid to use it and it will display it. It's also easy to serialise as well. I should have thought of this before and mentioned it earlier.

If any one wants to see an example, let me know.

Cheers,
Glenn.

Draftek

  • Guest
Re: Palette Problem
« Reply #24 on: August 17, 2006, 07:39:11 AM »
Count 1.

I'd like to see it.

Glenn R

  • Guest
Re: Palette Problem
« Reply #25 on: August 17, 2006, 07:19:04 PM »
Here you go - ponder the attached. It's fairly straighforward.

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: Palette Problem
« Reply #26 on: August 17, 2006, 08:20:31 PM »
The concept is quite good and easy to implement but I had some trouble using autocad object properties with the prop's grid in that it crashed when trying to update them. Properties of user defined classes are a snap though and the grid attributes save quite a bit of work.

I probably could have explored the problem further but put it in the too hard basket for now :)
« Last Edit: August 17, 2006, 08:22:13 PM by MickD »
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.
- J.R.R. Tolkien

Glenn R

  • Guest
Re: Palette Problem
« Reply #27 on: August 17, 2006, 09:03:55 PM »
I'm quite liking them actually, for the exact same reasons you just stated there Mick.
The property grid would be ideal to throw on a palette me thinks...

Glenn R

  • Guest
Re: Palette Problem
« Reply #28 on: August 17, 2006, 09:04:59 PM »
Got an example of how you were using it with AutoCAD objects handy Mick?

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: Palette Problem
« Reply #29 on: August 17, 2006, 09:25:06 PM »
I'll see if I kept the code, if not I'll knock something up, brb.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.
- J.R.R. Tolkien