Example #1
0
def SaveFontPreferences():
    win32ui.WriteProfileVal(sectionProfile, valueFormatTitle, str(formatTitle))
    win32ui.WriteProfileVal(sectionProfile, valueFormatInput, str(formatInput))
    win32ui.WriteProfileVal(sectionProfile, valueFormatOutput,
                            str(formatOutput))
    win32ui.WriteProfileVal(sectionProfile, valueFormatOutputError,
                            str(formatOutputError))
Example #2
0
	def SaveState(self):
		items = []
		for i in range(self.GetItemCount()-1):
			items.append(self.GetItemText(i,0))
		win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "Items", "\t".join(items))
		win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "Visible", self.IsWindowVisible())
		return 1
Example #3
0
def SaveWindowSize(section, rect):
    """ Writes a rectangle to an INI file
    Args: section = section name in the applications INI file
          rect = a rectangle in a (cy, cx, y, x) tuple
                 (same format as CREATESTRUCT position tuples)."""
    left, top, right, bottom = rect
    win32ui.WriteProfileVal(section, "left", left)
    win32ui.WriteProfileVal(section, "top", top)
    win32ui.WriteProfileVal(section, "right", right)
    win32ui.WriteProfileVal(section, "bottom", bottom)
Example #4
0
 def saveInitParams(self):
     # Only save the flags, not the text boxes.
     paramstr = "\t%s\t\t%d\t%d" % (
         self.filpattern,
         self.casesensitive,
         self.recurse,
     )
     win32ui.WriteProfileVal("Grep", "Params", paramstr)
Example #5
0
 def SaveState(self):
     self.list.DeleteAllItems()
     self.listOK = 0
     win32ui.WriteProfileVal(
         "Debugger Windows\\" +
         self.title,
         "Visible",
         self.IsWindowVisible())
Example #6
0
 def OnOK(self):
     dialog.PrintDialog.OnOK(self)
     strMag = self.magCtl.GetWindowText()
     try:
         self['mag'] = int(strMag)
     except:
         pass
     win32ui.WriteProfileVal(self.sectionPos, 'Document Magnification',
                             self['mag'])
Example #7
0
    def __init__(self, pInfo, dlgID, flags=win32ui.PD_USEDEVMODECOPIES):
        dialog.PrintDialog.__init__(self, pInfo, dlgID, flags=flags)
        mag = win32ui.GetProfileVal(self.sectionPos, 'Document Magnification',
                                    0)
        if mag <= 0:
            mag = 2
            win32ui.WriteProfileVal(self.sectionPos, 'Document Magnification',
                                    mag)

        self['mag'] = mag
Example #8
0
    def OnOK(self):
        # Handle the edit controls - get all the fonts, put them back into interact, then
        # get interact to save its stuff!
        controlAttrs = [(win32ui.IDC_EDIT1, interact.STYLE_INTERACTIVE_PROMPT),
                        (win32ui.IDC_EDIT2, interact.STYLE_INTERACTIVE_OUTPUT),
                        (win32ui.IDC_EDIT3, interact.STYLE_INTERACTIVE_ERROR)]
        for id, key in controlAttrs:
            control = self.GetDlgItem(id)
            fmt = control.GetDefaultCharFormat()
            win32ui.WriteProfileVal(interact.sectionProfile, key, str(fmt))

        # Save the other interactive window options.
        interact.SavePreference("Show at startup", self['bShowAtStartup'])
        interact.SavePreference("Docking", self['bDocking'])

        # And the other options.
        win32ui.WriteProfileVal("Settings", "Recent File List Size",
                                self['MRUSize'])

        return 1
Example #9
0
def WriteToolMenuItems(items):
    # Items is a list of (menu, command)
    # Delete the entire registry tree.
    try:
        mainKey = win32ui.GetAppRegistryKey()
        toolKey = win32api.RegOpenKey(mainKey, "Tools Menu")
    except win32ui.error:
        toolKey = None
    if toolKey is not None:
        while 1:
            try:
                subkey = win32api.RegEnumKey(toolKey, 0)
            except win32api.error:
                break
            win32api.RegDeleteKey(toolKey, subkey)
    # Keys are now removed - write the new ones.
    # But first check if we have the defaults - and if so, dont write anything!
    if items == defaultToolMenuItems:
        return
    itemNo = 1
    for menu, cmd in items:
        win32ui.WriteProfileVal("Tools Menu\\%s" % itemNo, "", menu)
        win32ui.WriteProfileVal("Tools Menu\\%s" % itemNo, "Command", cmd)
        itemNo = itemNo + 1
Example #10
0
def SavePreference(prefName, prefValue):
    win32ui.WriteProfileVal(sectionProfile, prefName, prefValue)
Example #11
0
 def saveInitParams(self):
     # Only save the flags, not the text boxes.
     paramstr = "\t\t\t%d\t%d" % (self.casesensitive, self.recurse)
     win32ui.WriteProfileVal("Pychecker", "Params", paramstr)
Example #12
0
def SaveDebuggerOptions(opts):
    for key, val in opts.items():
        win32ui.WriteProfileVal("Debugger Options", key, val)
Example #13
0
def DeleteEditorOption(option):
    try:
        win32ui.WriteProfileVal("Editor", option, None)
    except win32ui.error:
        pass
Example #14
0
def SetEditorOption(option, newValue):
    win32ui.WriteProfileVal("Editor", option, newValue)
 def SavePreference(self, name, value):
     win32ui.WriteProfileVal("Format", name, value)
Example #16
0
	def SavePreference(self, name, value):
		## LoadPreference uses -1 to indicate default
		if value is None:
			value=-1
		win32ui.WriteProfileVal("Format", name, value)