Bug: separators

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug: separators

bachinger software-2
To port our existing projects we need to open Top-Level-Windows by
hand.

The bug is:
If we add to a Menu a separator line all following menu
items are also shown as separator line. If we remove the
        menuB addSeparator
statement in class "CjbWindow" at method "open" the Menu looks well.
What do we wrong.

We work with Windows 98 2nd Edition.
Dolphin Smalltalk 4.01 Professional - Full Version
any advice would be helpful.

If there is anywhere a hard coded example of opening the class-
hierarchy browser or another complex window this would be very
helpful for us.


Reply | Threaded
Open this post in threaded view
|

Re: separators

Bill Schwab
> To port our existing projects we need to open Top-Level-Windows by
> hand.

Are you saying that you need to assemble the view in your source code rather
than by using the view compser?


> The bug is:
> If we add to a Menu a separator line all following menu
> items are also shown as separator line. If we remove the
> menuB addSeparator
> statement in class "CjbWindow" at method "open" the Menu looks well.
> What do we wrong.

Are you using any third-party add ons to Dolphin, or is CjbWindow a class of
your own?  The open method could be the problem, or you might be getting
hurt by an incorrect receiver.  Appologies if  it's too basic for you, but,
have a look at the "cascades, chains and the yourself message" part of the
following:

  http://www.object-arts.com/wiki/html/Dolphin/AdviceToBeginners.htm

I mention it because you might be capturing the return value of a compound
expression and having problems as a result.


> If there is anywhere a hard coded example of opening the class-
> hierarchy browser or another complex window this would be very
> helpful for us.

I'm assuming you want to build them in source code rather than using the
view composer.  The emergency view concept is the closest thing I can
remember.  Dolphin appears not to ship with it these days (though OA might
still use it internally???).  The idea was that if Dolphin couldn't load a
view resource for the debugger or CHB, then it would fall back on some
source code to open a tool that would allow the problem to be fixed.  If you
can still download Dolphin 2.1, you will find the #emergencyView: methods in
it.  Or with OA's permission, I can post them.

You might also want to look at the Pane Holders package (available on my web
site).  For a static view, you wouldn't want to use a pane holder for every
sub presenter, but, you will see how to create subpresenters and attach them
to a model.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: separators

Ian Bartholomew-5
In reply to this post by bachinger software-2
Hi,

> If we add to a Menu a separator line all following menu
> items are also shown as separator line. If we remove the
> menuB addSeparator
> statement in class "CjbWindow" at method "open" the Menu looks well.
> What do we wrong.
>
> We work with Windows 98 2nd Edition.
> Dolphin Smalltalk 4.01 Professional - Full Version
> any advice would be helpful.

I think you will have to give some more details about what you are actually
trying to do, the code you are using and where you are trying to do it.

One place you might look for hints about building menus is
ClassBrowserShell>>buildHistoryMenu:command:  As it stands it doesn't
include separators but I added the following to the above method - so the
last few lines now read as follows - and it works as expected with dividers
every 3 items

selectors add: sel.
"Added"
selectors size \\ 3 = 0
  ifTrue: [subMenu addItem: DividerMenuItem separator]].
"End added"
subMenu setDefault: 1].
popup setDefault: 1.
^popup

> If there is anywhere a hard coded example of opening the class-
> hierarchy browser or another complex window this would be very
> helpful for us.

Not exactly sure what you mean here.

I think you are asking how to create a view manually? The original versions
of Dolphin had methods that built a ClassBrowser in case the Resource loader
mechanism failed. I've included the code from ***2.1*** for creating the CHB
and also one of the menu creation methods.  I have no idea if it will all
work in 4.01 but I thought it might give you some hints?

Regards
    Ian

~-~-~-~-~-

emergencyView: aParentView
 "Create and answer default view for the receiver within aParentView.
 This method is included here to build a ClassBrowserShell view if something
 has gone wrong with the load from a resource. Perhaps the View hierarchy
 has been altered such that the STB file format has been changed. We need
 this emergency entry point to so that a browser can be started in order
 to put things right"

 | shell menubar classesView methodsView sourceView composite centrePane
 modeView definitionView cardView commentView categoriesView composite0
 toolbarView|

 "Menu"
 (menubar := MenuBar new)
  add: self fileMenu;
  add: self editMenu;
  add: self workspaceMenu;
  add: self classMenu;
  add: self methodMenu;
  add: self toolsMenu;
  add: self helpMenu.

 "Shell"
 shell := ShellView new.
 (aParentView addSubView: shell)
  layoutManager: BorderLayout new;
  menuBar: menubar.

 "Toolbar"
 toolbarView := self emergencyToolbar: shell.
 toolbarView arrangement: #north.

 "Top composite"
 composite0 := ContainerView new.
 (shell addSubView: composite0)
  arrangement: #center;
  layoutManager: (ProportionalLayout new vertical: true).

 "Inner composite"
 composite := ContainerView new.
 (composite0 addSubView: composite)
  layoutManager: ProportionalLayout new.

 "Classes"
 (classesView := TreeView new)
  beSmallIcons.
 (composite addSubView: classesView name: 'classes')
  contextMenu: self classContextMenu.

 "Splitter"
 (composite addSubView: Splitter new)
  arrangement: 0.

 "Centre pane"
 centrePane := ContainerView new.
 (composite addSubView: centrePane)
  layoutManager: BorderLayout new.

 "Splitter"
 (composite addSubView: Splitter new)
  arrangement: 0.

 "Mode"
 modeView := TabView new.
 (centrePane addSubView: modeView name: 'mode')
  arrangement: #north.

 "Categories"
 categoriesView := TreeView new.
 (centrePane addSubView: categoriesView name: 'categories')
  arrangement: #center;
  contextMenu: self categoryContextMenu;
  getTextBlock: self defaultGetCategoryTextBlock.

 "Methods"
 methodsView := ListBox new.
 (composite addSubView: methodsView name: 'methods')
  contextMenu: self methodContextMenu;
  getTextBlock: self defaultGetMethodTextBlock.

 "Splitter"
 (composite0 addSubView: Splitter new)
  arrangement: 0.

 "Card view"
 (cardView := CardContainer new)
  hasStaticEdge.
 composite0 addSubView: cardView name: 'cards'.

 "Source"
 (sourceView := self workspaceView: cardView)
  arrangement: 'Method &source'.
 cardView name: sourceView as: 'source'.

 "Definition"
 (definitionView := self workspaceView: cardView)
  arrangement: 'Class &definition';
  canHScroll: false.  "Word wrap preferred"
 cardView name: definitionView as: 'definition'.

 "Comment"
 (commentView := MultilineTextEdit new)
  canVScroll: true.
 (cardView addSubView: commentView name: 'comment')
  arrangement: 'Class c&omment';
  forecolor: Color darkGreen.

 "StatusBar"
 (shell addSubView: Status new)
  arrangement: #south;
  addItem: (StatusItem new
    getTextBlock: self notificationGetTextBlock;
    getImageBlock: self notificationGetImageBlock)
   name: 'errors'.
 ^shell

~-~-~-~-~-

classMenu
 "Private - Answer the class menu for the receiver's views' menubars."

 ^Menu fromStrings: #('&Class'
  '&New...//newClass'
  '&Delete//removeClass'
  'Default Package...//defaultPackage'
  '-'
  '&Rename...//renameClass'
  'Category...//categorizeClass'
  '-'
  'Inst Var Refs...//browseInstanceVariables'
  'Class Var Refs...//browseClassVariables'
  '&References...//browseClassReferences'
  '-'
  'Check &Out//checkOutClass'
  'Check &In...//checkInClass'
  '-'
  'File Out//fileOutClass'
  'File In//fileInClass'
  'Save Binary//saveBinaryClass'
  '-'
  'Find.../Ctrl+F/findClass')