Jump to content

fpiette

uniGUI Subscriber
  • Posts

    19
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by fpiette

  1. Since we have UniStringGrid source code, I could have put that code directly into the source. Hopefully, the code will be added to next uniGUI release :-)
  2. Thanks. As far as I can tell right now, it works. I have implemented a little bit differently, using a old Delphi trick to redefine an existing class (Only valid in current source file). It is enough and natural to call the new method. type TUniStringGrid = class(UniStringGrid.TUniStringGrid) public procedure Deselect; end; procedure TUniStringGrid.Deselect; begin JSInterface.JSCall('getSelectionModel().deselect', []); CurrCol := -1; CurrRow := -1; end;
  3. UniStringGrid1.JSInterface.JSCall('getSelectionModel().deselect', []); Actually, this doesn't work 100% correctly. It deselect the cell but affect only the display. Somewhere the underlying layers doesn't know the cell is deselected. This means that clicking again on the [now supposedly unselected] cell doesn't trigger the UniStringGridSelectCell event.
  4. In VCL, you unselect cell by using the Selection method like this : StringGrid1.Selection := TGridRect(Rect(-1, -1, -1, -1)); uniGUI should implement the same :-)
  5. UniStringGrid1.JSInterface.JSCall('getSelectionModel().deselect', []); This works. Thanks. In my opinion, UniStringGrid code should do that action in Row/Col property setter whenever the Row/Col value is invalid (Such as -1). Or provide a method to select/unselect a rectangular region in the grid.
  6. Yes, this is almost working (Well, there is a typo: Com should be Col. This is because copy/paste doesn't work in the form UI). It works except the first time actually.
  7. Create a new application having a UniStringGrid and a UniButton. Use the following code un UniButton1.click event Handler: UniStringGrid1.Row := -1; UniStringGrid1.Com := -1; Clicking on UniButton1 should deselect the currently selected cell in UniStringGrid1. It doesn't work always. Steps to reproduce: 1. Launch application -> No UniStringGrid cell selected -- Correct 2. Click on a UniStringGrid1 cell -> Cell selected and displayed in cyan -- Correct 3. Click UniButton1 -> Nothing happend -- Wrong: cell should be unselected 4. Click on another UniStringGrid cell -> Clicked cell is selected -- Correct -> First selected cell remains cyan (selected) -- Wrong 5. Click on a third UniStringGrid cell -> Cell is selected -- Correct -> Previous selected cell becomes white (unselected) -- Correct -> First selected cell remains cyan (selected) -- Wrong 6. Click UniButton1 -> Last selected cell becomes white (unselected) -- Correct -> First selected cell remains cyan (selected) -- Wrong -- François Piette Embarcadero MVP
  8. Nearly: I want to drag a cell from one grid to a different grid (The Sencha example drag from a grid and drop into the same grid).
  9. Use the standard uniGUI demo as starting point. In that demo, there is a drag and drop of StringGrid ROWS. i need drag&drop of a single cell. Thanks.
  10. Hello, How to drag a StringGrid cell to another StringGrid cell ? This is for a game. I have a first StringGrid with user's pièces and a second StringGrid being the game pad. The user has to drag one of his pieces (A cell on the first StringGrid) somewhere and drop it on the game pad (A cell on the second StringGrid). The application will then decide if the drop is valid or not. Any help appreciated. -- François Piette Embarcadero MVP
  11. Hello, In the sample Google Maps demo included with uniGUI, I added several markers on the map. Then I add an event listener which do an ajaxRequest against MainForm.UniHTMLFrame1. Then in Delphi code, I handle the event. This works very well. My question is: since the same event is used for several markers, I would like to pass the marker to the event Handler, much like "sender" in Delphi VCL. How to do that ? Excerpt form my code: Javascript: marker.addListener('dragend', function(e) { ajaxRequest(MainForm.UniHTMLFrame1, 'markerDragEnd', ['lat='+e.latLng.lat(), 'lng='+e.latLng.lng()]); } Delphi code (In TMainForm.UniHTMLFrame1AjaxEvent):: if EventName = 'markerDragEnd' then UniLabel1.caption := 'Lat: '+Params.Values['lat'] +', ' + Params.Values['lng']; Thanks.
  12. Hello, In the sample Google Maps demo included with uniGUI, I added several markers on the map. Then I add an event listener which do an ajaxRequest against MainForm.UniHTMLFrame1. Then in Delphi code, I handle the event. This works very well. My question is: since the same event is used for several markers, I would like to pass the marker to the event Handler, much like "sender" in Delphi VCL. How to do that ? Excerpt form my code: Javascript: marker.addListener('dragend', function(e) { ajaxRequest(MainForm.UniHTMLFrame1, 'markerDragEnd', ['lat='+e.latLng.lat(), 'lng='+e.latLng.lng()]); } Delphi code (In TMainForm.UniHTMLFrame1AjaxEvent):: if EventName = 'markerDragEnd' then UniLabel1.caption := 'Lat: '+Params.Values['lat'] +', ' + Params.Values['lng']; Thanks.
  13. Hello, I have the need to define a global javascript variable (Global or at least available in the TUniForm where it is declared). It has to survive as long as the form is alive and it must be accessible by javascript code pushed by UniSession.AddJS(). Where is the best place to declare such a variable? Any help appreciated. F. Piette
×
×
  • Create New...