I need a few answers before I can help you further.
First, how is the object moving? User input with keyboard (like pressing the right arrow key will make the object shift to the right, etc)?
If this is the case what I'd do is "catch" the users input (such as, the key they used) and figure out how this effects the values of your object.
For example, if the boards dimensions are 7x9 (7 rows down, 9 columns over) then it would look like this
---------
---------
---------
---------
---------
---------
---------
and an object within it can "visually" move around when I use a key command. If I press the right button then the column property of the object is incremented and the board is normally updated with dashes but includes the update for the object itself.
Since you know the dimensions of your object, you can probably treat it like a boxed-object (an object that exists in some kind of invisible bordering) and restrict movement if--
->the objects current position on the screen, plus its height (or length) does not exceed the board.
i.e...
---------
---------
---------
-----*---
-----**--
-----***-
---------
this triangle can move one more time to the right. It's position is (according to your syntax) Shape::the_board.area[y][x] where [y][x] is the dash right above the first asterisk. This has no character value but symbolically represents the starting position of your triangle.
If this is the case then simply save a copy of the old y and x positions and compare it to the new y and x positions. You can do something like oldx and oldy to store the values of the objects location before the move.
Then do subtraction - obviously if the x - oldx is positive you're planning on moving to the right. If this pushes the object out of bounds you dont want this to happen.
Assuming you have access to the value controlled by the user's input...
->create a variable that stores the objects position (oldx for the previous x position and oldy for the previous y position)
->perform bounds checking - it will most likely be ok for you to treat your triangle like a square (i.e. if your triangle is 3h 3b you can treat it like a 3x3 square during bounds checks).
->obviously use the value of the difference of the variables (x with oldx and y with oldy) to determine the new direction of the object. If it will cross the bound on a new move you only need to negate that movement from occurring and setting the newly placed values back to the old ones (because if the move fails then you need to make sure the variables are updated to the objects true position).
I'd need more information of the class you're using, knowledge of whether you have direct access to modify this class (or not) or any other useful information.
Edit: Whoops looks like you figured it out. Good deal =P