Changeset 10 for trunk/desktop/mainWindow.rbfrm
- Timestamp:
- 04/07/10 15:26:04 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/desktop/mainWindow.rbfrm
r9 r10 2630 2630 2631 2631 #tag WindowCode 2632 #tag Method, Flags = &h 02633 Sub disableControls()2632 #tag Method, Flags = &h21 2633 Private Sub disableControls() 2634 2634 select case ICSSerialPort1.carType 2635 2635 … … 2678 2678 #tag EndMethod 2679 2679 2680 #tag Method, Flags = &h 02681 Sub updateCarScreen()2680 #tag Method, Flags = &h21 2681 Private Sub updateCarScreen() 2682 2682 //Use this method to update the car screen 2683 2683 … … 2857 2857 #tag EndMethod 2858 2858 2859 #tag Method, Flags = &h 02860 Sub updateAdvancedScreen()2859 #tag Method, Flags = &h21 2860 Private Sub updateAdvancedScreen() 2861 2861 //Update the fields on the advanced screen to match current values 2862 2862 EditField_Byte1.Text = str(asc(ICSSerialPort1.byte01)) … … 2880 2880 End Sub 2881 2881 #tag EndMethod 2882 2883 #tag Method, Flags = &h21 2884 Private Sub readPreferences() 2885 dim filePreference as FolderItem = GetFolderItem("icspref.xml") 2886 dim xdoc as XmlDocument 2887 dim root as XmlNode 2888 dim i as Integer 2889 dim count as integer 2890 dim item as string 2891 2892 //Read the settings from the preferences file 2893 if filePreference <> Nil then 2894 xdoc = New XmlDocument(filePreference) 2895 2896 count = xdoc.DocumentElement.ChildCount 2897 2898 for i = 0 to count - 1 2899 root = xdoc.DocumentElement.Child(i) 2900 2901 item = root.FirstChild.Value 2902 2903 select case root.Name 2904 case "comPort" 2905 comPort = item 2906 end select 2907 next 2908 2909 else 2910 //Do nothing 2911 2912 end if 2913 End Sub 2914 #tag EndMethod 2915 2916 #tag Method, Flags = &h21 2917 Private Sub savePreferences() 2918 dim xml as XmlDocument 2919 dim root as XMLNode 2920 dim comPortXML as XmlNode 2921 dim f as FolderItem 2922 2923 //Save the preferences 2924 2925 f = GetFolderItem("icspref.xml") 2926 2927 if f <> Nil then 2928 //Create a new XML document 2929 xml = New XmlDocument 2930 root = xml.AppendChild(xml.CreateElement("icspref")) 2931 2932 //Add elements 2933 comPortXML = root.AppendChild(xml.CreateElement("comPort")) 2934 comPortXML.AppendChild(xml.CreateTextNode(comPort)) 2935 2936 //Save the output 2937 xml.SaveXml(f) 2938 end if 2939 2940 End Sub 2941 #tag EndMethod 2942 2943 2944 #tag Property, Flags = &h0 2945 comPort As string 2946 #tag EndProperty 2882 2947 2883 2948
Note: See TracChangeset
for help on using the changeset viewer.