Re: [Gambas-user] Gridview icon detection
Hi Fabien, Thank you for the example but I made a mistake and it’s not for a GRIDVIEW but for ColumnView that I would detect the Icon. Do you have any idea to do that please ? Olivier Cruilles > Le 19 janv. 2017 à 07:46, Gianluigia écrit : > > Hi Fabien, > > very interesting especially the explanation of _Draw :-) > > I thank you so much > > Regards > > Gianluigi > > 2017-01-19 12:07 GMT+01:00 Fabien Bodard : > >> Ok this is my fault as i've not tested my code ... so i've forgot to >> little things >> >> This is so the working code : >> >> >> Private aMyValues As New String[] >> Private aMyStates As New Integer[] >> Private aMyPicState As New Picture[3] >> >> Public Sub _New() >> >> aMyPicState[0] = Picture["img/checked.png"] >> aMyPicState[1] = Picture["img/unchecked.png"] >> aMyPicState[2] = Picture["img/tristate.png"] >> >> 'Load here values and states in arrays >> aMyValues.Push("First") >> aMyStates.Push(CheckBox.True) >> aMyValues.Push("Second") >> aMyStates.Push(CheckBox.None) >> aMyValues.Push("Third") >> aMyStates.Push(CheckBox.False) >> gridview1.columns.count = 2 >> gridview1.Columns[0].Width = 22 >> >> GridView1.Rows.height = 22 >> >> GridView1.Rows.Count = aMyValues.Count >> >> End >> >> Public Sub GridView1_Data(Row As Integer, Column As Integer) >> >> Select Case Column >> >>Case 0 >> Last.Data.Picture = aMyPicState[aMyStates[Row] + 1] >>Case 1 >> Last.data.text = aMyValues[Row] >> >> End Select >> >> End >> >> Public Sub GridView1_Click() >> >> If Last.Column = 0 Then >>Inc aMyStates[GridView1.Row] >>If aMyStates[GridView1.Row] > 1 Then aMySTates[GridView1.Row] = -1 >> Endif >> GridView1.Refresh >> >> End >> >> >> And I've corrected your project and added a form that show how to use >> the _draw event. Here it allow to get checkboxes drawed with the >> current desktop theme. >> >> >> -- >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, SlashDot.org! http://sdm.link/slashdot >> ___ >> Gambas-user mailing list >> Gambas-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/gambas-user >> >> > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user -- Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gridview icon detection
Hi Fabien, very interesting especially the explanation of _Draw :-) I thank you so much Regards Gianluigi 2017-01-19 12:07 GMT+01:00 Fabien Bodard: > Ok this is my fault as i've not tested my code ... so i've forgot to > little things > > This is so the working code : > > > Private aMyValues As New String[] > Private aMyStates As New Integer[] > Private aMyPicState As New Picture[3] > > Public Sub _New() > > aMyPicState[0] = Picture["img/checked.png"] > aMyPicState[1] = Picture["img/unchecked.png"] > aMyPicState[2] = Picture["img/tristate.png"] > > 'Load here values and states in arrays > aMyValues.Push("First") > aMyStates.Push(CheckBox.True) > aMyValues.Push("Second") > aMyStates.Push(CheckBox.None) > aMyValues.Push("Third") > aMyStates.Push(CheckBox.False) > gridview1.columns.count = 2 > gridview1.Columns[0].Width = 22 > > GridView1.Rows.height = 22 > > GridView1.Rows.Count = aMyValues.Count > > End > > Public Sub GridView1_Data(Row As Integer, Column As Integer) > > Select Case Column > > Case 0 > Last.Data.Picture = aMyPicState[aMyStates[Row] + 1] > Case 1 > Last.data.text = aMyValues[Row] > > End Select > > End > > Public Sub GridView1_Click() > > If Last.Column = 0 Then > Inc aMyStates[GridView1.Row] > If aMyStates[GridView1.Row] > 1 Then aMySTates[GridView1.Row] = -1 > Endif > GridView1.Refresh > > End > > > And I've corrected your project and added a form that show how to use > the _draw event. Here it allow to get checkboxes drawed with the > current desktop theme. > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > > -- Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gridview icon detection
Ok this is my fault as i've not tested my code ... so i've forgot to little things This is so the working code : Private aMyValues As New String[] Private aMyStates As New Integer[] Private aMyPicState As New Picture[3] Public Sub _New() aMyPicState[0] = Picture["img/checked.png"] aMyPicState[1] = Picture["img/unchecked.png"] aMyPicState[2] = Picture["img/tristate.png"] 'Load here values and states in arrays aMyValues.Push("First") aMyStates.Push(CheckBox.True) aMyValues.Push("Second") aMyStates.Push(CheckBox.None) aMyValues.Push("Third") aMyStates.Push(CheckBox.False) gridview1.columns.count = 2 gridview1.Columns[0].Width = 22 GridView1.Rows.height = 22 GridView1.Rows.Count = aMyValues.Count End Public Sub GridView1_Data(Row As Integer, Column As Integer) Select Case Column Case 0 Last.Data.Picture = aMyPicState[aMyStates[Row] + 1] Case 1 Last.data.text = aMyValues[Row] End Select End Public Sub GridView1_Click() If Last.Column = 0 Then Inc aMyStates[GridView1.Row] If aMyStates[GridView1.Row] > 1 Then aMySTates[GridView1.Row] = -1 Endif GridView1.Refresh End And I've corrected your project and added a form that show how to use the _draw event. Here it allow to get checkboxes drawed with the current desktop theme. BrokenCode-0.0.1.tar.gz Description: GNU Zip compressed data -- Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user