The Artima Developer Community
Sponsored Link

Agile Buzz Forum
How To Create A Custom Widget - Dynamic Look Change

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
How To Create A Custom Widget - Dynamic Look Change Posted: Dec 2, 2004 2:13 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: How To Create A Custom Widget - Dynamic Look Change
Feed Title: Pollock
Feed URL: http://www.cincomsmalltalk.com/rssBlog/pollock-rss.xml
Feed Description: Pollock - the next VW GUI
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Pollock

Advertisement

We have finished the basics of our Calendar. There some things we haven't addressed as yet, like the size of the drop down, but we'll leave those things behind for now as we start to address the look of our pane for MacOSX and Motif looks.


Discusson

Pollock has, as one of its design imperatives, that when the look of the application is changed, the widgets of that application should automatically change to the new look. This is called the Dynamic Look Changing feature of Pollock.

This is unlike the Wrapper framework, where the user actually had to capture the change event, and then capture model data, rip down the interface, re-rebuild it, and finally reinstall model data.

Therefore, as a widget creator, you are responsible for making your widget participate in any look changing. You can of course decide that your widget will look the same on all looks, and thus, do nothing. Or you can decide to only support some looks.

Here though, we'll assume full responsibility, and make our widget adapt for each look dynamically.


To See What We Can See

Let's start off with looking at what we have in different looks. To do that, first let's open one of our testers:

	CalendarTest new openWindowWithCalendarAndButton.

I like this one because it has a Button. Anyway, instead of having to open the settings tool to switch looks, I have a utility:

	PollockWorkspaceWork new openLookSwitcherWindow

This is a simple Pollock window that allows us to dynamically switch the look of the system (it resets itself when you close it to whatever the look was when you opened it).

We can press the Motif, MacOSX and Windows buttons in turn and see what our Calendar looks like. Remember, we designed this for the Windows 9x/2K look.

For comparison, we should have a regular drop down list to compare our work with... So, let's open another sample window:

	PollockWorkspaceWork new openWindowWithDropDownBigListAndButton

As we change from one look to another, the DropDownList will change properly for the look, and we can compare visual elements to what our Calendar looks like.


Motif Look Problems

When we switch to the Motif look, our Calendar has the following visual problems:

  • In Motif, a "Drop Down List" pane is made up of two visually separated items. The "input" area and the Button.
  • Our pane, designed as it is for Windows, looks like one single enclosed area, with a button and input field in it. We need to make them look separate.
  • The input field with it's lowered border should butt up against the button which it's raised border.
  • When we open the drop down, The first thing we see is that the navigation buttons are just little dots, not the size we made them for Windows. This is because, by default, Motif buttons have a 7 wide external area that they take up with selection and default indicators. This is the yellow ring you can see in our drop down list with button example.
  • The Grid in the drop down takes up more room vertically depending on your font... We need to adjust the grid or the drop down itself to make the grid fit fully without being clipped.

MacOSX Look Problems

When we switch to the MacOSX look, our Calendar has even more visual problems:

  • The button part should be a jelly thing like a DropDownList, with rounded right top and right bottom corners.
  • The input part should have a much thinner border and no so gray.
  • When the whole part has focus, it should have a blue haze around it.
  • When we open the drop down, the navigation buttons look horrible.. they're attempting to look like small versions of the MacOSX jelly button, and they fail. We should use what the MacOSX guide calls Round buttons.
  • Like with the Motif look, the Grid doesn't fit properly.

Details To Come

That's enough for today... No code.

Next time we'll start by making an overview of the Dynamic Look Change support in the framework, and then tackle the Motif look for our Calendar.


And So It Goes
Sames

Read: How To Create A Custom Widget - Dynamic Look Change

Topic: SUnitToo Updates Previous Topic   Next Topic Topic: A Unit Test Pattern

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use