[Circle] Off topic. There. I said it.

From: Patrick Dughi (dughi@imaxx.net)
Date: 09/14/00

        I'm writing a GUI editor, as you all know.  It just needs some
save routines written and I'll put out a room-editing only system.  The
problem (as will be pointed out by many) is that I am unused to o-o
programming in a visual environment.

        So I need suggestions by people who have actually done this.

Example; I have a form for room editing.  It has several dialog boxes on
it - one is for 'jump to room'.  Currently, it works quite nicely.  It
looks horrendous in code though.

        Here's what it does;

        The room-edit form calls an 'OnJumpToRoomButtonPress' type of
function.  This function creates a new class (jumpbox) based off of the
dialog box class, and causes it to be modal (ie, is active while the app
is not, among other things).  The box has rudimentary checking on the room
target's validity (the world is global exactly like in circlemud, this I
know how to make more OO, so ignore) and when it's done, it grabs the room
editor form by way of the the main app (theApp)-> the room editor class ->
the current room, sets that, and hten calls the room editor's loadroom
function.  All in all, it looks something like this;

m_jump_string is the warning message, and m_new_room is the inputted new
room.  They're validated & displayed via DDX/DDV.

void JumpBox::OnOk()
  extern CCbreakApp theApp;

  if(m_new_room > 32699 || m_new_room < 0) {
          m_jump_string = "Out of Range";

  if(real_zone_by_thing(m_new_room) == NOWHERE) {
          m_jump_string = "That zone DNE";

  if(real_room(m_new_room) == NOWHERE) {
                m_jump_string = "That room DNE";

  theApp.dlg->current_room = real_room(m_new_room);


        So, in the end, I have to make most of the major parts of my room
forms accessable to this dialog, public in this case.  This is not how it
ought to be.  What is the standard way of dealing with this?  Should I
just write annoying accessor functions for setting the current room, or,
_what_ ?

        Not that I'm unaware of OO design, mind you, just that it's easier
when you don't have to instantiate a new class each time you want to make
modifications to members within a pre-existing class with other sorts..

        I can't help it. Here's an ObCircle; the creators of Dikumud (at
least those who I could contact) have been talking about, and generally
positive towards GPL'ing the code.  Nothing's fixed yet, just like last
time I brought up this subject, but this time it sounds positive, instead
of shot-in-the-dark.

        If you don't know what I'm talking about, that's okay.

                        *bonks you on the head*

        Maybe I should write RMS for advice?


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |

This archive was generated by hypermail 2b30 : 04/11/01 PDT