Announcement

Collapse
No announcement yet.

BUG? - Radio Button Visibility not working when Redraw is disabled

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • BUG? - Radio Button Visibility not working when Redraw is disabled

    Hi. I created a function to show/hide specific objects on a page.
    When I disable page redrawing (or DialogEx) the radiobuttons are not hidden or shown again properly. Only when I do not disable redrawing the buttons disappear and reappear. It's a bug?

    Example Code:
    Code:
    function ShowSettings(nCategory)
    Debug.ShowWindow(true);
    -- Objects with "x" as first char in the object name are static and always displayed
    
    	--DialogEx.SetRedraw(false);
    	-- Hide Items
    	tblObjects = DialogEx.EnumerateObjects();
    	Debug.Print("nCategory: "..nCategory.."\r\n");
    	for i, v in pairs(tblObjects) do
    		strCat = String.Left(v, 1);
    		
    		if strCat ~= "x" then
    			strCat = String.ToNumber(strCat); -- dont compare str with nCategory number!
    			
    			nObjType = DialogEx.GetObjectType(v);
    			--Debug.Print("nObjType: "..nObjType.."\r\n");
    			--Debug.Print("strCat: "..strCat.."\r\n");
    
    			if nObjType == OBJECT_LABEL and strCat ~= nCategory then
    				Label.SetVisible(v, false);
    			elseif nObjType == OBJECT_LABEL and strCat == nCategory then
    				Label.SetVisible(v, true);
    			end
    			
    			if nObjType == OBJECT_IMAGE and strCat ~= nCategory then
    				Image.SetVisible(v, false);
    			elseif nObjType == OBJECT_IMAGE and strCat == nCategory then
    				Image.SetVisible(v, true);
    			end
    			
    			if nObjType == OBJECT_RADIOBUTTON and strCat ~= nCategory then
    				Debug.Print("HideRadio: "..v.."\r\n");
    				RadioButton.SetVisible(v, false);
    			elseif nObjType == OBJECT_RADIOBUTTON and strCat == nCategory then
    				Debug.Print("ShowRadio: "..v.."\r\n");
    				RadioButton.SetVisible(v, true);
    			end
    		end
    	end
    
    	DialogEx.SetRedraw(true);
    	--DialogEx.Redraw();
    
    end
    Bl4ckSh33p-Soft - Custom Software and Indie Games

  • #2
    If you disable page drawing then the page wont draw anything so a button set to hidden will be hidden but the page wont show so because it cant redraw.

    Comment


    • #3
      But it works for labels and images. I disable redraw, show/hide the objects, enable redraw and all objects are visible. But the RadioButtons always stay the same.
      I thought disabling redraw is exactly for this, to show/hide objects without flickering items on screen and showing all changes at once?
      Bl4ckSh33p-Soft - Custom Software and Indie Games

      Comment


      • #4
        call page redraw when you've turned redraw back on.

        Comment


        • #5
          Don't forget:

          Application.SetRedraw(true); --other option/workaround if Page.Redraw() does'nt quite do the job.

          I also suggest that when reporting possible bugs-niggles that you:

          Provide the Version of AMS you are building with and the Operating system or systems you have
          tested the built runtime on as this assists IR or others who read this section of the Forum

          Comment

          Working...
          X