Re: Preferences dialog: Not implementing options without hacks

From: msevior_at_physics.unimelb.edu.au
Date: Fri Apr 09 2004 - 20:29:56 EDT

  • Next message: Christian Neumair: "Re: Preferences dialog: Not implementing options without hacks"

    >
    >>
    >> I'm currently re-polishing the UNIX preferences dialog and stumbled
    >> across the following problem:
    >> I need a getter/setter for each setting although I don't have a widget
    >> associated with it, e.g. the toolbar show/hiding is controlled via the
    >> view menu, so I don't need any prefs UI for that. I don't want to
    >> implement dummy getters/setters that return the prefs from the
    >> cross-platform backend, because I consider it hacky to return something
    >> to the cross-platform code I received from the cross-platform code
    >> inside platform-specific code. I don't know much about CPP encapsulation
    >> but wouldn't it be possible to have cross-platform getters/setters that
    >> can be overridden by platform-specific code, but don't have to. This
    >> would simplify my task a lot.
    >>
    >

    I just re-read your email and after looking at the code realized that you
    have no choice but to return the same values set from the xp code if you
    don't implement them. They're defined as "pure virtual" for good reason.
    They must be implemented in platform code. If they do nothing because you
    can't adjust them in the dialog then they should not be defined in the XP
    layer.

    So the solution is simply to remove the methods that do not have a GUI
    implementation in the Options dialog from the XP layer.

    Since they're defined as pure virtual but are not actually unused I think
    this will be safe on the other platforms although they should remove them
    from the platform code too.

    Cheers

    Martin



    This archive was generated by hypermail 2.1.4 : Sat Apr 10 2004 - 01:59:24 EDT