Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [nebula-dev] [compositetable] arrive initially not fired in row 0

Hi Dave

I am currently working on my celleditor layer (in the row object) and I
startet by implementing an AbstractEditableRow (looking at what you've
done in AbstractSelectableRow). I use user defined widgets in my row and
only taint the currently selected row to indicate the selected row. I do
not have the 'problem' you have with clabels in AbstractSelectableRow that
do not get focused. I therefore just set the background in the
arrive-method.
The bug I found is that if you select row 0 in a first step, the
arrive-method is not triggered. Subsequent selects fire correctly. The
reason for this is in InternalCompositeTable:

public void focusGained(TableRow sender, FocusEvent e) {
 ...
 if (senderRowNumber != currentRow) {
 ...
}

senderRow is initially 0 and current row is 0, too, so fireing is skipped!

My thought on this is that the currentRow does initially not reflect the
correct widget state. If currentRow == 0 was correct, row 0 would have to
get an arrive-event initially and eventually be selected and thats not the
case. I thought that you did not want to select a row initially to let
user decide if they want to have an initial selection or not (what's the
default behaviour for swt widgets).
I therefore suggest the following fix, that works for me:

(initilalization to -1 of currentRow in the end of the Constructor)

public InternalCompositeTable(Composite parentControl, int style) {
  super(parentControl, style);
  ...
  currentRow = -1; // initialize to undefined
}


(further check in currentRow() for the undefined state of currentRow)

private TableRow currentRow() {
  if (currentRow > rows.size() - 1 || currentRow < 0) {
    return null;
  }

I can post the bug to bugzilla with my patch if you want me to :-)

Regards
André

ps. I posted a bug & patch for gtk yesterday. Hope you saw that beast ;-)

> :-) It's the least I could do. Thank you for your high-quality feedback!
>
>
> Dave
> ----- Original Message -----
> From: André Dietisheim <dietisheim@xxxxxxxxx>
> To: djo@xxxxxxxxxxxxxxxxxxxxxxxxx
> Sent: Monday, February 5, 2007 8:05:52 AM GMT-0600
> Subject: Re: [nebula-dev] [compositetable] 0.9.2 released
>
> Thanks very much for the credit!! :-)
>
>> Thanks much to Andre and others who have contributed to this build!!!
>
> --
> André Dietisheim
> Stv-Bereichsleiter Products
>
> Puzzle ITC GmbH
> Eigerplatz 4
> CH-3007 Bern
> Telefon +41 31 370 22 00
> Mobile +41 76 423 03 02
> Fax +41 31 370 22 01
>
> Puzzle ist Mitglied der ODF Alliance:
> <http://www.puzzle.ch/odfalliance/>
>
>
>
>
> !DSPAM:45c748d5319401728274286!


-- 
André Dietisheim
Stv-Bereichsleiter Products

Puzzle ITC GmbH
Eigerplatz 4
CH-3007 Bern
Telefon +41 31 370 22 00
Mobile  +41 76 423 03 02
Fax     +41 31 370 22 01

Puzzle ist Mitglied der ODF Alliance:
<http://www.puzzle.ch/odfalliance/>




Back to the top