none
Size button malfunctions RRS feed

  • Question

  • I added some size buttons to my paint program but they don't seem to be working, Size one just does the bugged new button, size2 doesn't do anything, the others haven't been told to do anything yet. I know how to fixe size one but what's wrong with size 2?
    TDR505
    Wednesday, April 22, 2009 11:25 PM

Answers

  • The Hacker,

    I did figure out what you were saying about the size buttons.  Didn't realize that when you hit the pensize button that it opened up other buttons and that is where the size buttons were.  The buttoncheck() routine needed to be incorporated in your mousedown routine.  Here's a snippet showing where I put it.  Now it does change the size.  It doesn't show it on the screen, but the size is changed.

      New()
    ElseIf(prevX > YellowX And prevX < (YellowX + ButtonWi)) And (prevY > YellowY And prevY < (YellowY + ButtonHe))Then
      GraphicsWindow.PenColor = "yellow"
      L = GraphicsWindow.PenColor
      GraphicsWindow.BrushColor = "white"
      GraphicsWindow.FillRectangle(GraphicsWindow.Width-GraphicsWindow.Width+10,GraphicsWindow.Height-50,300,12)
    GraphicsWindow.BrushColor = L
    GraphicsWindow.DrawBoundText(GraphicsWindow.Width-GraphicsWindow.Width+10,GraphicsWindow.Height-50,300, "Pen.Color = " + L)
    GraphicsWindow.BrushColor = "black"
    Else
      ButtonCheck()
    EndIf


    Here's a copy of how I changed the code around: KML234  This includes the change to get the size buttons to work and for my comments from above to get the new graphics window.

    JR

    Thursday, April 23, 2009 3:13 AM
    Answerer

All replies

  • The Hacker,

    After looking at your code I have a suggestion.  The first lines of code, down to the continuous while loop is basically the same as the new subroutine.  So, I deleted the lines in the new sub and then I copied the first part of your code from the beginning down to the while loop and put it in sub new.  At the top of the program i just put a call to new().  That made the new button work better.  At least it would redraw the rectangle, but left lines that I had drawn in the window.  So, then I put a graphicswindow.clear() in the new() routine.  And then the window would clear.  I think that is what your wanting the new button to do is give a new graphicswindow to paint on.

    Sorry, but I didn't understand size2 from above.  I think Size1 is referring to the new button, but I couldn't figure out the other one.

    JR
    Thursday, April 23, 2009 1:58 AM
    Answerer
  • Honestly I don't understand what your are saying so could you publish it then put the code please? Or just post an EX: of what you did?
    Thursday, April 23, 2009 2:33 AM
  • The Hacker,

    I did figure out what you were saying about the size buttons.  Didn't realize that when you hit the pensize button that it opened up other buttons and that is where the size buttons were.  The buttoncheck() routine needed to be incorporated in your mousedown routine.  Here's a snippet showing where I put it.  Now it does change the size.  It doesn't show it on the screen, but the size is changed.

      New()
    ElseIf(prevX > YellowX And prevX < (YellowX + ButtonWi)) And (prevY > YellowY And prevY < (YellowY + ButtonHe))Then
      GraphicsWindow.PenColor = "yellow"
      L = GraphicsWindow.PenColor
      GraphicsWindow.BrushColor = "white"
      GraphicsWindow.FillRectangle(GraphicsWindow.Width-GraphicsWindow.Width+10,GraphicsWindow.Height-50,300,12)
    GraphicsWindow.BrushColor = L
    GraphicsWindow.DrawBoundText(GraphicsWindow.Width-GraphicsWindow.Width+10,GraphicsWindow.Height-50,300, "Pen.Color = " + L)
    GraphicsWindow.BrushColor = "black"
    Else
      ButtonCheck()
    EndIf


    Here's a copy of how I changed the code around: KML234  This includes the change to get the size buttons to work and for my comments from above to get the new graphics window.

    JR

    Thursday, April 23, 2009 3:13 AM
    Answerer