Jump to content

Farshad Mohajeri

Administrators
  • Posts

    12121
  • Joined

  • Last visited

  • Days Won

    808

Everything posted by Farshad Mohajeri

  1. CaretPos will not be available on server side. We can't update a server side coordinate each time user types a key. It will create lots of unwanted ajax traffic. It has meaning only on client side. For a possible client side solution refer to Ext JS documentation.
  2. Here is your component adopted to TUniCustomComboBox by making few changes to your original code. I didn't test its functionality as I didn't know how to. It compiles, installs and appear in both web and vcl mode. unit ComboboxYeni; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, uniComboBox; type TComboBoxYeni = class(TUniCustomComboBox) private FValue : String; FList : TStrings; SonTus : Word; FAllValueList : TStrings; FParentValue: String; FAllItemList: TStrings; FParentValueList: TStrings; FTag: Longint; procedure SetValueControl(const Value: String); procedure SetValueList(const Value: TStrings); Function GetValueControl : String; procedure SetAllValueList(const Value: TStrings); procedure SetParentValue(const Value: String); procedure SetAllItemList(const Value: TStrings); procedure SetParentValueList(const Value: TStrings); procedure SetTag(const Value: Longint); { Private declarations } protected procedure KeyDown(var Key: Word; Shift: TShiftState); override; procedure DoExit;override; { Protected declarations } public LastKey : Word; constructor Create(AOwner: TComponent); override; destructor Destroy; override; Procedure ItemSil(Const PValue : String); Procedure ItemEkle(Const PItem,PValue ,PParentValue: String); Procedure ParentValueSil(Const PValue : String); Procedure ClearAll; function TirnakliText : String; Property AllValueList : TStrings Read FAllValueList Write SetAllValueList; Property AllItemList : TStrings Read FAllItemList Write SetAllItemList; Property ParentValueList : TStrings Read FParentValueList Write SetParentValueList; { Public declarations } published property Value : String read GetValueControl write SetValueControl; property ValueList : TStrings read FList write SetValueList; property ParentValue : String read FParentValue write SetParentValue; property Tag: Longint read FTag write SetTag; property Style; {Must be published before Items} property Anchors; property Color; property Constraints; property Enabled; property Font; property MaxLength; property ParentBiDiMode; property ParentColor; property ParentFont; property ParentShowHint; property ShowHint; property Sorted; property TabOrder; property TabStop; property Visible; property OnClick; property OnDblClick; property OnEnter; property OnExit; property OnKeyDown; property OnKeyPress; property OnKeyUp; property Items; { Must be published after OnMeasureItem } { Published declarations } end; procedure Register; implementation procedure Register; begin RegisterComponents('Standard', [TComboBoxYeni]); end; { TComboBoxYeni } constructor TComboBoxYeni.Create(AOwner: TComponent); begin inherited Create(AOwner); FList := TStringList.Create; FAllValueList := TStringList.Create; FAllItemList := TStringList.Create; FParentValueList:= TStringList.Create; FValue := ''; Try ItemIndex := Tag; Except End; end; destructor TComboBoxYeni.Destroy; begin FList.Free; FAllValueList.Free; FAllItemList.Free; FParentValueList.Free; inherited Destroy; end; procedure TComboBoxYeni.SetValueControl(const Value: String); begin FValue := Value; Try ItemIndex := ValueList.IndexOf(Value); Except ItemIndex := -1; End; end; Function TComboBoxYeni.GetValueControl : String; begin Try Result := ValueList.Strings[itemIndex] Except Result := ''; End; end; procedure TComboBoxYeni.KeyDown(var Key: Word; Shift: TShiftState); begin SonTus := Key; if ((SonTus = 8) or (SonTus = VK_DELETE)) then begin SonTus := 0; ItemIndex := -1; end; inherited KeyDown(Key,Shift); // If (Style = csDropDownList) And (Key = VK_DELETE) Then // ItemIndex := -1; end; function TComboBoxYeni.TirnakliText: String; begin Result := #39 + Trim(Value) + #39; end; procedure TComboBoxYeni.DoExit; begin If Text = '' Then Begin ItemIndex := -1; Value := ''; Hint := Value; End; //Else ItemIndex := ValueIndex; Inherited ; end; procedure TComboBoxYeni.SetValueList(const Value: TStrings); begin FList.Assign(Value); end; procedure TComboBoxYeni.SetAllValueList(const Value: TStrings); begin FAllValueList.Assign(Value); end; procedure TComboBoxYeni.SetAllItemList(const Value: TStrings); begin FAllItemList.Assign(Value); end; procedure TComboBoxYeni.SetParentValueList(const Value: TStrings); begin FParentValueList.Assign(Value); end; procedure TComboBoxYeni.SetParentValue(const Value: String); Var I : Integer; begin FParentValue := Value; If (AllValueList.Count > 0) Then Begin Items.Clear; // Listedekileri siler. ValueList.Clear; // Değer listesini siler... If ParentValueList.Count > 0 Then Begin For I := 0 To AllValueList.Count - 1 Do Begin If (ParentValueList.Strings[i] = FParentValue) or (FParentValue = '') Then Begin ValueList.Add(AllValueList.Strings[i]); Items.Add(AllItemList.Strings[i]); End; End; End Else Begin For I := 0 To AllValueList.Count - 1 Do Begin ValueList.Add(AllValueList.Strings[i]); Items.Add(AllItemList.Strings[i]); End; End; End; end; procedure TComboBoxYeni.SetTag(const Value: Longint); begin FTag := Value; Try ItemIndex := Value; Except ItemIndex := -1; End; end; procedure TComboBoxYeni.ItemSil(const PValue: String); Var I : Integer; begin // Tüm listeden siler I := AllValueList.IndexOf(PValue); If I > -1 Then Begin AllItemList.Delete(I); AllValueList.Delete(I); End; // Geçerli olan listeden siler... I := ValueList.IndexOf(PValue); If I > -1 Then Begin ValueList.Delete(I); Items.Delete(I); End; end; procedure TComboBoxYeni.ItemEkle(const PItem, PValue, PParentValue: String); begin If (PItem <> '') And (PValue <> '') And (PParentValue <> '') Then Begin AllValueList.Add(PValue); AllItemList.Add(PItem); ParentValueList.Add(PParentValue); Items.Add(PItem); End; end; procedure TComboBoxYeni.ParentValueSil(const PValue: String); Var I : Integer; begin For I := 0 To ParentValueList.Count - 1 Do Begin If ParentValueList.Strings[i] = PValue Then Begin ParentValueList.Delete(I); AllValueList.Delete(I); AllItemList.Delete(I); End; End; SetParentValue(ParentValue); end; procedure TComboBoxYeni.ClearAll; begin Items.Clear; ValueList.Clear; ParentValueList.Clear; AllValueList.Clear; AllItemList.Clear; end; end.
  3. Sorry I didn't understand your question.
  4. There is no explicit limit to parameter size. However, parameters are URIencoded before sending to the server and it adds lots of overhead to the binary stream.It may increase size of binary stream to 2 or 3 times.
  5. I'm not aware of such technology, which allows sending files without displaying a dialog screen first. Can you point us to a page that implements this feature?
  6. For obvious reasons file upload dialog can not be omitted. File upload is a native browser functionality. For security reasons a web site can not upload a file from users' disk without asking them first. Otherwise everyone could grab files with sensitive information.
  7. You maybe able to create a new component with same functionality based on TUniCustomComboBox.
  8. What is your purpose for doing this? Why users simply don't type into those fields?
  9. Server side: uses ...uniGUIAplication, procedure TMainForm.UniButton1Click(Sender: TObject); begin UniSession.AddJS(' your JS code'); end; Client side: function OnClick(sender, e) { your code here } See our demos for client side scripting.
  10. document.getElementById('UrlFrame_id').contentWindow.document.getElementById('input_id').value="test text"; You must replace UrlFrame_id and input_id with proper real ids.
  11. Use a tool like firebug to investigate its id.
  12. 1) No. Ext4 generates conventional DOM. Ext.dd.DragDrop is also available in Ext3. One may be able to implement it. I can't say yes or no at this stage because I can't dedicate much time to investigate possibility of D&D in Ext JS or uniGUI. 2) We have Script property in UniForm where you can put custom JS code.
  13. Not always. Please note that your article is for HTML5 not regular DOM. it is for Ext.dd.DragDrop component which currently have no equivalent in uniGUI. Ext JS implements almost all major events. It is not easy to extend JS new events from Delphi code.
  14. OK. I understand him now. Yes above code is the only way to retrieve info from an embedded iframe. In uniGUI iframe id is "iframe_"+(Delphi Name) Conisder you have UniUrlFrame1 on Form. Its web id is iframe_UniUrlFrame1
  15. We have StripeRows property.. It may not be much visible on LCD monitors. You can play with related CSS code in theme CSS file and make it more visible.
  16. I really don't understand what you want to achieve. Do you want to retrieve "id" of TUniUrlFrame? If yes for what purpose? Please explain your problem in more details.
  17. What is the type of DragDrop object? DropTarget.ClientEvents.ExtEvents.Add( 'Ondragenter=function dragEnter(e){e.stopPropagation();e.preventDefault();}' ); Ondragenter?? Is this event supported by Ext JS? Your above syntax only works for predefined events in Ext JS. Besides your referred article is about D6D in HTML5 not in Ext JS.
  18. Next build will add HTML property to TUniUrlFrame which allows directly adding HTML content to UrlFrame.
  19. if WebMode then begin end;
  20. It can only be accessed in webmode.
×
×
  • Create New...