Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r39 - trunk

genelib
Discussion topic

Back to topic list

svn commit: r39 - trunk

Author lotec
Full name Jan Bogaerts
Date 2006-04-22 08:12:16 PDT
Message Author: LoTeC
Date: 2006-04-22 08:12:16-0700
New Revision: 39

Modified:
   trunk/Application.gen
   trunk/Controls.gen

Log:
various small bugfixes

Modified: trunk/Application.gen
Url: http://genelib.tigri​s.org/source/browse/​genelib/trunk/Applic​ation.gen?view=diff​&rev=39&p1=tr​unk/Application.gen​&p2=trunk/Applica​tion.gen&r1=38​&r2=39
====================​====================​====================​==================
--- trunk/Application.gen (original)
+++ trunk/Application.gen 2006-04-22 08:12:16-0700
@@ -113,40 +113,40 @@
           //create and show mainform
           MainForm = #(self.MainForm).Create(nil)
           Application.MainForm = MainForm
-// User32.ShowWindow( iMainForm.Handle, nCmdShow )
- //call code
- #(self.code)
- MainForm.Visible = true
- #[#<-self.SplashS​creen.NrRecords > 0->
- //destroy splash
- iSplash.Destroy
- #]
- //enter message loop
- iMessVal: int
           try
- iMessVal = User32.GetMessage(@M​essageStruct, nil, 0,0)
- {<-iMessVal == -1->
- MessageStruct.wParam = 1
- System.RaiseLastOsError
- <-iMessVal <> 0->
- try
- [<-MessageStruct.Handle == nil || User32.TranslateAcce​lerator(MainForm.Han​dle, gActionList.Handle, @MessageStruct) == 0->
- User32.TranslateMess​age(@MessageStruct)
- ]
- User32.DispatchMessa​ge(@MessageStruct)
- //we use a peek to see if there are any messages, if not, do an update of the actions and wait till something comes in
- [<-User32.PeekMes​sage(@messageStruct,​ nil, 0, 0, PM_NOREMOVE) == 0->
- gActionList.Doupdate
- ]
- iMessVal = User32.GetMessage(@M​essageStruct, nil, 0,0)
- except var aExc: Exception&
- sMessageBox.ShowErro​r(aExc.Text)
- except sMessageBox.ShowError('There was an unexpected error in the application.')
- }
- except var aExc: Exception&
- sMessageBox.ShowErro​r(aExc.Text)
- except sMessageBox.ShowError('There was an unexpected error in the application, quiting...')
- Mainform.destroy
+ //call code
+ #(self.code)
+ MainForm.Visible = true
+ #[#<-self.SplashS​creen.NrRecords > 0->
+ //destroy splash
+ iSplash.Destroy
+ #]
+ //enter message loop
+ iMessVal: int
+ try
+ iMessVal = User32.GetMessage(@M​essageStruct, nil, 0,0)
+ {<-iMessVal == -1->
+ MessageStruct.wParam = 1
+ System.RaiseLastOsError
+ <-iMessVal <> 0->
+ try
+ [<-MessageStruct.Handle == nil || User32.TranslateAcce​lerator(MainForm.Han​dle, gActionList.Handle, @MessageStruct) == 0->
+ User32.TranslateMess​age(@MessageStruct)
+ ]
+ User32.DispatchMessa​ge(@MessageStruct)
+ //we use a peek to see if there are any messages, if not, do an update of the actions and wait till something comes in
+ [<-User32.PeekMes​sage(@messageStruct,​ nil, 0, 0, PM_NOREMOVE) == 0->
+ gActionList.Doupdate
+ ]
+ iMessVal = User32.GetMessage(@M​essageStruct, nil, 0,0)
+ except var aExc: Exception&
+ sMessageBox.ShowErro​r(aExc.Text)
+ except sMessageBox.ShowError('There was an unexpected error in the application.')
+ }
+ except var aExc: Exception&
+ sMessageBox.ShowErro​r(aExc.Text)
+ except sMessageBox.ShowError('There was an unexpected error in the application, quiting...')
+ finally Mainform.destroy
           return(int(MessageSt​ruct.wParam))
        ;
      

Modified: trunk/Controls.gen
Url: http://genelib.tigri​s.org/source/browse/​genelib/trunk/Contro​ls.gen?view=diff​&rev=39&p1=trunk​/Controls.gen&p2​=trunk/Controls.gen​&r1=38&r2=39
====================​====================​====================​==================
--- trunk/Controls.gen (original)
+++ trunk/Controls.gen 2006-04-22 08:12:16-0700
@@ -1329,12 +1329,12 @@
  entity sListBoxItem$
  store stLinkedList
  space Owner //indicate that the ListBoxItem stores a ref to the space itself, so that sListBoxItems.entity is compacter
- var Owner: sListBox^
+ prop Owner: sListBox^ read var fOwner: sListBox^ = nil
+ write exp SetOwner(aValue: sListBox^)
  operator '<<' AddItem(aItem: self.entity)
           '<<' InsertItem(aItem: self.entity, aBefore: self.entity)
           '>>' Removeitem(aItem: self.entity)
           '->>' RemoveAllItems
- constructor Create(aOwner: sListBox^) = Owner = aOwner;
 ;
 control sListBox =
  controlType 11
@@ -1342,7 +1342,7 @@
  BorderStyle 7
  AdditionalStyles LBS_Notify
  prop ItemIndex: int read exp GetItemIndex: int write exp SetItemIndex(aValue: int) //which item is selected
- Items: sListBoxItems read var fItems: sListBoxItems.Create(self) //the list of items
+ Items: sListBoxItems read var fItems: sListBoxItems //the list of items
       TopIndex: int read exp GetTopIndex: int write exp SetTopIndex(aValue: int) //Specifies the index number of the item that appears at the top of the list box.
 // AutoRedraw: bool read exp GetAutoRedraw: bool write exp SetAutoRedraw(aValue: bool) //specifies if listbox is automatically redrawn when item is added or not
 // MultiSelect: bool read var fMultiSelect: bool = false write exp SetMultiSelect(aVal: bool)//determins if multiselect or not, when changed, the object gets recreated, best set in construction list
@@ -1351,6 +1351,7 @@
      FindStringExact(aValue: string&, aAfter: sListBoxItem^): fItems.entity //search for text (case insensitive) after specified item, returns first item found that exactly matches the text
      SelectString(aValue: string&, aAfter: sListBoxItem^): fItems.entity //search for text (case insensitive) after specified item, selects and returns first item found that begins with the string
      DoSearch(aValue: string&, aAfter: sListBoxItem^, aSearchtype: dword): fItems.entity //internally used to perform the searches
+ Init override
 ;
 
 
@@ -1405,6 +1406,11 @@
    ]
 ;
 
+exp sListBoxItems.SetOwner(aValue: sListBox^)
+=
+ [<-fOwner <> nil-> raise(exception.crea​te('ListboxItems already has an owner'))]
+ fOwner = aValue
+;
 
 exp sListBoxItems.AddItem(aItem: sListBoxItems.entity)
 =
@@ -1464,6 +1470,12 @@
    User32.SendMessage(O​wner.Handle, dword(LB_RESETCONTENT), 0, 0)
 ;
 
+exp sListBox.Init
+=
+ inherited
+ fItems.Owner = self
+;
+
 exp sListBox.GetItemIndex: int
 =
    iRes: int

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r39 - trunk lotec Jan Bogaerts 2006-04-22 08:12:16 PDT
Messages per page: