Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Splitter » Why Splitter::GetChildCount() is not public???- GetCount [SOLVED]
Re: Why Splitter::GetChildCount() is not public??? [message #1965 is a reply to message #1963] Wed, 29 March 2006 00:45 Go to previous messageGo to previous message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
luzr wrote on Tue, 28 March 2006 22:54

fudadmin wrote on Tue, 28 March 2006 16:34

luzr wrote on Tue, 28 March 2006 20:31

fudadmin wrote on Tue, 28 March 2006 13:18

fudadmin wrote on Tue, 28 March 2006 18:11

Why Splitter::GetChildCount() is not public???

and PosToClient()...



Well, over time I have found "keep the interface minimal" a good practice. Sometimes I am wrong about interface, but enriching it is quite easy thing. But the opposite, removing stuff from interface, is much more dangerous bussines (angry users... Smile.

Mirek


The users are angry when they find inconsistant interfaces - in some Ctrl's the same methods are public, in some - not. It looks like I will have to maintain my own version of Ultimate++...


PosToClient nor GetChildCount is not common public interface....

Mirek


Originally I meant only count of children. In HeaderCtrl you can have GetCount() which is a number of children? Why all similar controls can't have the same?

Regarding private interfaces - this is where I completely agree with Lisp and Assembler advocates - "C++ was created for stupid programmers"...

P.S
On the other hand Fox-toolkit is not afraid to make public this kind of methods
  /// Return true if specified window is owned by this window
  FXbool isOwnerOf(const FXWindow* window) const;

  /// Return true if specified window is ancestor of this window
  FXbool isChildOf(const FXWindow* window) const;

  /// Return true if this window contains child in its subtree
  FXbool containsChild(const FXWindow* child) const;

  /// Return the child window at specified coordinates
  FXWindow* getChildAt(FXint x,FXint y) const;

  /// Return the number of child windows for this window
  FXint numChildren() const;

  /**
  * Return the index (starting from zero) of the specified child window,
  * or -1 if the window is not a child or NULL
  */
  FXint indexOfChild(const FXWindow *window) const;

  /**
  * Return the child window at specified index,
  * or NULL if the index is negative or out of range
  */
  FXWindow* childAtIndex(FXint index) const;

  /// Return the common ancestor of window a and window b
  static FXWindow* commonAncestor(FXWindow* a,FXWindow* b);

[Updated on: Wed, 29 March 2006 00:55]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: setters of Splitter should return Splitter& [ADDED]
Next Topic: The case of the disappearing splitter.
Goto Forum:
  


Current Time: Mon May 06 03:34:07 CEST 2024

Total time taken to generate the page: 0.02796 seconds