Subject Re: Turn Off Windows Theme
From Mervyn Bick <invalid@invalid.invalid>
Date Mon, 9 Jul 2018 22:07:34 +0200
Newsgroups dbase.getting-started
Attachment(s) set_systemTheme_false.prg

On 2018-07-09 3:42 PM, Michael wrote:
> I wam upgrading all my legacy Visual Dbase 7.5 to Dbase 11 and maybe even Windows 12. The biggest issue I have is that the default setting for all controls is the Windows Theme is set to TRUE and all my buttons are greyed out.
> This may not sound like much but I have over 400,000 lines of code with hundreds of forms and buttons and will take me a year to convert them all to FALSE so my software can retail the custom colours and Labels set throughout the software.
> How can I turn windows theme off or set DBASE controls to have Windows Theme turns off?
> Anyone?

As Rich has suggested a little dBASE program will make short work of
this.  First though you need to create a custom form with the
systemTheme property set false.  Then you need to create a .cc file
containing custom pushbutton, grid and whatever other controls you have
used also with the systemTheme property set false.

****** systemtheme_false.cfm ******
class systemtheme_falseCForm of FORM custom
    with (this)
         systemTheme = false

******** ************
class mypb(parentObj) of PUSHBUTTON(parentObj) custom
        systemTheme = false

  class mygrid(parentObj) of  GRID(parentObj) custom
        systemTheme = false

// any other classes you may need

The little example program attached only deals with pushbuttons and
grids.  If you change names of the .cfm and .cc files and of the custom
objects you will, of course need to edit the program accordingly.

It goes without saying that you should make sure you have an up-to-date
backup copy of all your source files safely tucked away before you try this.


_app.allowyieldonmsg = true
aDir = new array()
aDir1 = new array()
for n = 1 to aDir1.size/5
nFileCount = 0
for n = 1 to aDir.size
     cFileIn = aDir[n]
     cFileOut = "out"+aDir[n]
     if not file("out"+aDir[n])
          nFilecount ++
          fIn = new file()

          fOut = new file()
          if n%10 = 0
          do while not fIn.eof()
               cRead = fIn.readln()
               if 'class'$lower(cRead) and 'of form'$lower(cRead)
                    cRead = stuff(cRead,at('of form',lower(cRead)),7,' of systemtheme_falseCform from systemtheme_false.cfm')
                    cRead= '       set procedure to  additive'
               elseif  'systemtheme'$lower(cRead) and 'true'$lower(cRead) //will probably never be executed as true is default whch is not streamed out
                    cRead = stuff(cRead,at('true',lower(cRead)),4,'false ')
               elseif 'new pushbutton'$lower(cRead)
                    cRead =  stuff(cRead,at('new pushbutton',lower(cRead)),14,'new mypb ')
               elseif 'new grid'$lower(cRead)
                    cRead =  stuff(cRead,at('new grid',lower(cRead)),8,'new mygrid ')
                    // add other ontrols as necessary with each one in it's own elseif section.
          new file().delete(cFileIn)
          new file().rename(cFileOut,cFileIn)

?  nFileCount+' .wfm files processed'