IonicWind Software

Aurora Compiler => Coding Help - Aurora 101 => Topic started by: ExMember001 on December 04, 2006, 06:55:54 PM

Title: Listview not redrawing
Post by: ExMember001 on December 04, 2006, 06:55:54 PM
Hi,
I have a little problem, and i don't find the answer...
when i resize a column in the listview the listview erase itself and redraw partially...
How can i fix this?

I have include the code in the zip below.
to compile, create a project and add the 3 files.

the listview is in the Plugins tab, so click on Plugins and resize the columns in the listview control to see what i'm talking about.

Ho, and i will suggest to not use the apply button, well nothing dangerous, but this will create registry keys... just dont use the Apply Button ;)
Title: Re: Listview not redrawing
Post by: J B Wood (Zumwalt) on December 04, 2006, 07:40:57 PM
Interesting, the scroll bars need a redraw, and they get it if you scroll using the vertical bar.
What is going on for the bars, is that when the listviews are shorter than needing a horizontal bar, the horizontal bar disappears but the grey area isn't refreshed normally.
Is the listview a control you created?

edit:
add to that if you switch windows to another window that covers the listview, it doesn't get redrawn
Title: Re: Listview not redrawing
Post by: ExMember001 on December 04, 2006, 09:07:16 PM
Quote from: Jonathan (zumwalt) Wood on December 04, 2006, 07:40:57 PM
Is the listview a control you created?

The control is created with addcontrol in the OpenDLG() method
Title: Re: Listview not redrawing
Post by: Rock Ridge Farm (Larry) on December 06, 2006, 06:36:22 AM
That is similar to the problem I posted earlier (see lost topic)-
I wanted a signal to tell me that I had an event related to
the list view.
I defined a global var extern_evt and set it to 0 when I left the listview so I would know that I needed
a refresh if it was set to 1 on return.
If anything changed in the other functions I would set it to 1.
I tend to think in terms of events - on event do something. An event can be anything
you wish to know about.
Aurora has many events built in but as usual I always want more.
Title: Re: Listview not redrawing
Post by: Ionic Wind Support Team on December 06, 2006, 09:19:24 PM
Create the tab control last and your drawing problem will be solved:


OptionsDLG::OpenDLG(CWINDOW *Parent)
{
//Player = *Parent;
Create(0,0,513,368,0x80C80080,0,"AmpKC - Options",Parent);
AddControl(CTTREEVIEW,"Static",15,15,136,298,0x50810037,0,O_TREEVIEW);
AddControl(CTDEFBUTTON,"Close",427,326,70,28,0x50010001,0x0,O_CloseB);
AddControl(CTBUTTON,"Apply",346,326,70,28,0x58010000,0x0,O_ApplyB);
//AddControl(CTTABCTRL,"Tab Control",168,15,329,298,0x54010040,0x0,O_TABS);

//Filetypes tab
AddControl(CTGROUPBOX,"Select the file types to open with AmpKC",175,45,313,140,0,0,FT_FTGROUP);
AddControl(CTCHECKBOX,"*.mp1",190,75,50,20,0,0,FT_CBMP1);
AddControl(CTCHECKBOX,"*.mp2",190,100,50,20,0,0,FT_CBMP2);
AddControl(CTCHECKBOX,"*.mp3",190,125,50,20,0,0,FT_CBMP3);
AddControl(CTCHECKBOX,"*.m3u",190,150,50,20,0,0,FT_CBM3U);
AddControl(CTCHECKBOX,"*.ogg",350,75,50,20,0,0,FT_CBOGG);
AddControl(CTCHECKBOX,"*.wav",350,100,50,20,0,0,FT_CBWAV);
AddControl(CTCHECKBOX,"*.aif",350,125,50,20,0,0,FT_CBAIF);
AddControl(CTCHECKBOX,"Register Automaticaly Formats in Plugins",190,200,250,20,0,0,FT_CBADDPLUG);
AddControl(CTCHECKBOX,"Check at start if AmpKC is the default audio player",190,225,255,20,0,0,FT_CBDEFAULT);

//Views tab
//Normal Mode
AddControl(CTGROUPBOX,"Select the View you want to start with",175,45,313,70,0,0,VW_VWGROUP);
AddControl(CTCHECKBOX,"Tags View",190,75,80,20,0,0,VW_CBTAG);
AddControl(CTCHECKBOX,"Informations View",350,75,105,20,0,0,VW_CBINFO);

//AlBum Mode
AddControl(CTGROUPBOX,"Select the View you want to start with",175,45,313,95,0,0,AL_VWGROUP);
AddControl(CTCHECKBOX,"Tags View",190,75,80,20,0,0,AL_CBTAG);
AddControl(CTCHECKBOX,"Images View",190,100,105,20,0,0,AL_CBIMG);
AddControl(CTCHECKBOX,"Informations View",350,75,105,20,0,0,AL_CBINFO);

AddControl(CTGROUPBOX,"Slideshow Parameters",175,150,313,95,0,0,AL_SLPGROUP);
AddControl(CTSTATIC,"Delay :",190,175,70,20,0,0x0,AL_DELAY);
AddControl(CTEDIT,"5",233,173,40,20,AES_CENTER|AES_NUMBER,0x0,AL_Time);
AddControl(CTSTATIC,"Secs",283,175,70,20,0,0x0,AL_DELAY2);

//Plugins tab
AddControl(CTGROUPBOX,"Loaded Plugins informations",175,45,313,260,0,0,Plug_Group);
AddControl(CTLISTVIEW,"",185,65,293,232,AWS_BORDER|ALVS_AUTOARRANGE|ALVS_REPORT,0,Plug_Listv);

AddControl(CTTABCTRL,"Tab Control",168,15,329,298,0x54010040,0x0,O_TABS);

DoModal();
return;
}
Title: Re: Listview not redrawing
Post by: Bruce Peaslee on December 06, 2006, 10:40:16 PM
Quote from: Paul Turley on December 06, 2006, 09:19:24 PM
Create the tab control last and your drawing problem will be solved:


I worked on this a while. Why does this fix the problem?
Title: Re: Listview not redrawing
Post by: Ionic Wind Support Team on December 07, 2006, 05:16:49 AM
The windows TAB control will redraw over sibling controls since they share the same parent window.  If he made the controls a child of the TAB that would have solved it as well.

Changing the order of ADDCONTROL statements changes the order in which Windows creates the control from the dialog template.  In this case the tab control is created first, just something I have run into before with dialog templates.

Paul.
Title: Re: Listview not redrawing
Post by: ExMember001 on December 07, 2006, 02:09:26 PM
Quote from: Paul Turley on December 07, 2006, 05:16:49 AM
The windows TAB control will redraw over sibling controls since they share the same parent window.  If he made the controls a child of the TAB that would have solved it as well.

Changing the order of ADDCONTROL statements changes the order in which Windows creates the control from the dialog template.  In this case the tab control is created first, just something I have run into before with dialog templates.

Paul.

thanx paul, i didnt think about creating the listview as a child of the tab control, good idea :)
thanx for helping guys !