m_aboutToFinish = false;
wxRect rectLabel;
+ int offset = 8;
owner->GetItemRect(itemEdit, rectLabel);
m_text->Create(owner, wxID_ANY, m_startValue,
- wxPoint(rectLabel.x+8,rectLabel.y),
- wxSize(rectLabel.width,rectLabel.height));
+ wxPoint(rectLabel.x+offset,rectLabel.y),
+ wxSize(rectLabel.width-offset,rectLabel.height));
m_text->SetFocus();
m_text->PushEventHandler(this);
{
m_macIsUserPane = true;
- if ( !wxWindow::Create(parent, id, pos, size, style | wxNO_BORDER, name) )
+ long paneStyle = style;
+ paneStyle &= ~wxSIMPLE_BORDER;
+ paneStyle &= ~wxDOUBLE_BORDER;
+ paneStyle &= ~wxSUNKEN_BORDER;
+ paneStyle &= ~wxRAISED_BORDER;
+ paneStyle &= ~wxSTATIC_BORDER;
+ if ( !wxWindow::Create(parent, id, pos, size, paneStyle | wxNO_BORDER, name) )
return false;
// since the generic control is a child, make sure we position it at 0, 0
return m_genericImpl->SetItemState(item, state, stateMask);
wxListItem info;
+ info.m_itemId = item;
info.m_mask = wxLIST_MASK_STATE;
info.m_stateMask = stateMask;
info.m_state = state;
- info.m_itemId = item;
return SetItem(info);
}
id = (DataBrowserItemID) thisItem;
}
else
- id = item;
+ id = item+1;
GetDataBrowserItemPartBounds( m_dbImpl->GetControlRef(), id, col, part, &bounds );
if ( !(GetWindowStyleFlag() & wxLC_NO_HEADER) )
y -= colHeaderHeight;
+ if ( y < 0 )
+ return -1;
+
int row = y / rowHeight;
DataBrowserItemID id;
m_dbImpl->GetItemID( (DataBrowserTableViewRowIndex) row, &id );
wxString itemText;
wxString otherItemText;
int colId = sortProperty - kMinColumnId;
- long itemNum = 0;
- long otherItemNum = 0;
wxListCtrl* list = wxDynamicCast( GetPeer() , wxListCtrl );
- // means we need to
if (colId >= 0)
{
if (!m_isVirtual)
wxMacListCtrlItem* item = (wxMacListCtrlItem*)itemOneID;
wxMacListCtrlItem* otherItem = (wxMacListCtrlItem*)itemTwoID;
wxListCtrlCompare func = list->GetCompareFunc();
+ long item1 = GetLineFromItem(item);
+ long item2 = GetLineFromItem(otherItem);
+
if (func != NULL && item->HasColumnInfo(colId) && otherItem->HasColumnInfo(colId))
- return func(item->GetColumnInfo(colId)->GetData(), otherItem->GetColumnInfo(colId)->GetData(), list->GetCompareFuncData()) >= 0;
+ return func(item1, item2, list->GetCompareFuncData()) >= 0;
- itemNum = item->GetOrder();
- otherItemNum = otherItem->GetOrder();
if (item->HasColumnInfo(colId))
itemText = item->GetColumnInfo(colId)->GetText();
if (otherItem->HasColumnInfo(colId))
}
else
{
- itemNum = (long)itemOneID;
- otherItemNum = (long)itemTwoID;
+
+ long itemNum = (long)itemOneID;
+ long otherItemNum = (long)itemTwoID;
itemText = list->OnGetItemText( itemNum-1, colId );
otherItemText = list->OnGetItemText( otherItemNum-1, colId );
//if (item)
{
wxMacListCtrlItem* listItem = dynamic_cast<wxMacListCtrlItem*>(dataItem);
- wxListItem* oldItem = listItem->GetColumnInfo( column );
-
- long mask = item.GetMask();
- if ( !mask )
- // by default, get everything for backwards compatibility
- mask = -1;
+
+ if (!listItem->HasColumnInfo( column ))
+ return;
- if ( mask & wxLIST_MASK_TEXT )
- item.SetText(oldItem->GetText());
- if ( mask & wxLIST_MASK_IMAGE )
- item.SetImage(oldItem->GetImage());
- if ( mask & wxLIST_MASK_DATA )
- item.SetData(oldItem->GetData());
- if ( mask & wxLIST_MASK_STATE )
- item.SetState(oldItem->GetState());
- if ( mask & wxLIST_MASK_WIDTH )
- item.SetWidth(oldItem->GetWidth());
- if ( mask & wxLIST_MASK_FORMAT )
- item.SetAlign(oldItem->GetAlign());
+ wxListItem* oldItem = listItem->GetColumnInfo( column );
- item.SetTextColour(oldItem->GetTextColour());
- item.SetBackgroundColour(oldItem->GetBackgroundColour());
- item.SetFont(oldItem->GetFont());
+ if (oldItem)
+ {
+ long mask = item.GetMask();
+ if ( !mask )
+ // by default, get everything for backwards compatibility
+ mask = -1;
+
+ if ( mask & wxLIST_MASK_TEXT )
+ item.SetText(oldItem->GetText());
+ if ( mask & wxLIST_MASK_IMAGE )
+ item.SetImage(oldItem->GetImage());
+ if ( mask & wxLIST_MASK_DATA )
+ item.SetData(oldItem->GetData());
+ if ( mask & wxLIST_MASK_STATE )
+ item.SetState(oldItem->GetState());
+ if ( mask & wxLIST_MASK_WIDTH )
+ item.SetWidth(oldItem->GetWidth());
+ if ( mask & wxLIST_MASK_FORMAT )
+ item.SetAlign(oldItem->GetAlign());
+
+ item.SetTextColour(oldItem->GetTextColour());
+ item.SetBackgroundColour(oldItem->GetBackgroundColour());
+ item.SetFont(oldItem->GetFont());
+ }
}
}
if (mask & wxLIST_MASK_WIDTH)
listItem->SetWidth(item->GetWidth());
- listItem->SetTextColour(item->GetTextColour());
- listItem->SetBackgroundColour(item->GetBackgroundColour());
- listItem->SetFont(item->GetFont());
+ if ( item->HasAttributes() )
+ {
+ if ( listItem->HasAttributes() )
+ listItem->GetAttributes()->AssignFrom(*item->GetAttributes());
+ else
+ {
+ listItem->SetTextColour(item->GetTextColour());
+ listItem->SetBackgroundColour(item->GetBackgroundColour());
+ listItem->SetFont(item->GetFont());
+ }
+ }
}
}