| Anonymous | Login | Signup for a new account | 2013-06-19 18:50 CEST | ![]() |
| All Projects | FPC | Lazarus: Packages, Patches | Lazarus CCR | Mantis | fpGUI | fpcprojects: fpprofiler |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||
| 0021987 | Lazarus | LCL | public | 2012-05-08 18:01 | 2012-06-01 08:41 | ||||
| Reporter | Ihor Lavrynyuk | ||||||||
| Assigned To | Jesus Reyes | ||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||
| Status | closed | Resolution | fixed | ||||||
| Platform | x64 | OS | Windows 7 | OS Version | Ultimate SP1 V5 | ||||
| Product Version | 1.1 (SVN) | Product Build | 37219 | ||||||
| Target Version | Fixed in Version | 1.1 (SVN) | |||||||
| Summary | 0021987: StringGrid DrawCell aCol draws previous columns item | ||||||||
| Description | http://www.youtube.com/watch?v=nlNunJZ6ZS8 [^] draws previous columns item... procedure TfrmMain.StringGridGroupsDrawCell(Sender: TObject; aCol, aRow: Integer; aRect: TRect; aState: TGridDrawState); var bmp: TBitmap; begin //if ((aCol=1) AND (aRow > 0)) then begin // AND (aRow > 0)) if (StringGridGroups.Columns.Items[aCol].Title.Caption='id') then begin bmp := TBitmap.Create; FrmMain.ImageList2.GetBitmap(0,bmp); StringGridGroups.Canvas.Draw(aRect.Left,aRect.Top,bmp); bmp.Free; end; end; | ||||||||
| Tags | No tags attached. | ||||||||
| Fixed in Revision | 37296 | ||||||||
| LazTarget | - | ||||||||
| Widgetset | Win32/Win64 | ||||||||
| Attached Files | |||||||||
Notes |
|
|
(0059407) Ihor Lavrynyuk (reporter) 2012-05-08 18:08 edited on: 2012-05-08 18:08 |
and maybe need add StringGridGroups.Columns.Items[aCol].Name because if (title='Найменування') in source editor -> its not good style =) if(StringGridGroups.Columns.Items[aCol].Title.Caption='Найменування') |
|
(0059657) Jesus Reyes (developer) 2012-05-16 23:18 |
I have fixed the problem of Sorted Column indicator. The problem drawing on previous column is not a bug, when you are using Custom Columns, grid.Columns.Count<>grid.ColCount, OnDrawCell draws both custom columns and normal columns. Check grids reference for property columns for an explantaion: http://wiki.lazarus.freepascal.org/Grids_Reference_Page#property_Columns [^] To fix the problem in your code, I would do: // check if we are drawing custom columns zone if aCol>=grid.FixedCols then begin // adjust the column index so we can use grid.columns[x] aCOl := aCol - grid.FixedCols; // then your code... end; |
|
(0059692) Ihor Lavrynyuk (reporter) 2012-05-17 19:48 |
please recommend me, as I find column by name? but no title and no aCol title I have 'Найменування' aCol - can be moved ... maybe need also property name for TStringGrid.Column ? c: TGridColumn; begin // add a custom column a grid c := Grid.Columns.Add; c.title.name := 'title'; // modify c.title.caption := 'Найменування'; // Set columns caption c.align := taRightJustify; // Align column content to the right c.color := clMoneyGreen; // Changes default color to clMoneyGreen c.Index := 0; // Make it the first column // access an existing column grid.columns[0].Width := 60; // Change column 0 width to 60 pixels // delete an existing column grid.columns.delete(0); // Delete column 0 .... end; |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-05-08 18:01 | Ihor Lavrynyuk | New Issue | |
| 2012-05-08 18:01 | Ihor Lavrynyuk | File Added: issue.zip | |
| 2012-05-08 18:01 | Ihor Lavrynyuk | Widgetset | => Win32/Win64 |
| 2012-05-08 18:08 | Ihor Lavrynyuk | Note Added: 0059407 | |
| 2012-05-08 18:08 | Ihor Lavrynyuk | Note Edited: 0059407 | |
| 2012-05-09 05:41 | Jesus Reyes | Status | new => assigned |
| 2012-05-09 05:41 | Jesus Reyes | Assigned To | => Jesus Reyes |
| 2012-05-16 23:18 | Jesus Reyes | Fixed in Revision | => 37296 |
| 2012-05-16 23:18 | Jesus Reyes | LazTarget | => - |
| 2012-05-16 23:18 | Jesus Reyes | Status | assigned => resolved |
| 2012-05-16 23:18 | Jesus Reyes | Fixed in Version | => 1.1 (SVN) |
| 2012-05-16 23:18 | Jesus Reyes | Resolution | open => fixed |
| 2012-05-16 23:18 | Jesus Reyes | Note Added: 0059657 | |
| 2012-05-17 19:48 | Ihor Lavrynyuk | Note Added: 0059692 | |
| 2012-06-01 08:41 | Ihor Lavrynyuk | Status | resolved => closed |
| Main | My View | View Issues | Change Log | Roadmap |



