{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% osCommerce Product Manager for Windows (oscpmwin). Copyright ©2003,2004,2005 by Mario A. Valdez-Ramirez. You can contact Mario A. Valdez-Ramirez by email at mario@mariovaldez.org or paper mail at Olmos 809, San Nicolas, NL. 66495, Mexico. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} unit askuser; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons; type Topm_Form_AskUser = class(TForm) opm_Label_AskUserTitle: TLabel; opm_Edit_AskUserData: TEdit; opm_BitBtn_AskUserOk: TBitBtn; opm_BitBtn_AskUserCancel: TBitBtn; opm_ComboBox_AskUserList: TComboBox; procedure FormShow(Sender: TObject); procedure FormCreate(Sender: TObject); procedure opm_BitBtn_AskUserOkClick(Sender: TObject); private public AU_Title : STRING; AU_Directions : STRING; AU_PassChar : CHAR; AU_MaxLen : LONGINT; AU_TextOrList : BOOLEAN; AU_DataText : STRING; AU_DataList : TStringList; AU_ListItem : LONGINT; AU_PreCleanList : BOOLEAN; AU_DataListText : STRING; end; var opm_Form_AskUser: Topm_Form_AskUser; implementation uses gnugettext, main, oscpmdata, balloons; {$R *.dfm} {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} procedure Topm_Form_AskUser.FormShow(Sender: TObject); begin opm_Form_AskUser.Caption := AU_Title; opm_Label_AskUserTitle.Caption := AU_Directions; opm_Edit_AskUserData.Enabled := AU_TextOrList; opm_Edit_AskUserData.Visible := AU_TextOrList; opm_ComboBox_AskUserList.Enabled := NOT (AU_TextOrList); opm_ComboBox_AskUserList.Visible := NOT (AU_TextOrList); IF (AU_TextOrList = TRUE) THEN BEGIN opm_Edit_AskUserData.PasswordChar := AU_PassChar; opm_Edit_AskUserData.MaxLength := AU_MaxLen; opm_Edit_AskUserData.Text := AU_DataText; opm_ComboBox_AskUserList.Items.Clear; opm_Form_AskUser.FocusControl (opm_Edit_AskUserData); END ELSE BEGIN opm_Edit_AskUserData.PasswordChar := #0; opm_Edit_AskUserData.MaxLength := 0; opm_Edit_AskUserData.Text := ''; IF (AU_DataListText <> '') THEN opm_ComboBox_AskUserList.Items.Text := AU_DataListText ELSE opm_ComboBox_AskUserList.Items := AU_DataList; IF (AU_PreCleanList = TRUE) THEN BEGIN opm_ComboBox_AskUserList.Items.Delete (0); opm_ComboBox_AskUserList.Items.Delete (opm_ComboBox_AskUserList.Items.Count - 1); END; opm_ComboBox_AskUserList.ItemIndex := AU_ListItem; opm_Form_AskUser.FocusControl (opm_ComboBox_AskUserList); END; end; {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} procedure Topm_Form_AskUser.FormCreate(Sender: TObject); begin AU_Title := ''; AU_Directions := ''; AU_PassChar := #0; AU_MaxLen := 0; AU_TextOrList := FALSE; AU_DataText := ''; AU_ListItem := 0; AU_PreCleanList := FALSE; AU_DataListText := ''; TranslateComponent (self); end; {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} procedure Topm_Form_AskUser.opm_BitBtn_AskUserOkClick(Sender: TObject); begin AU_Title := ''; AU_Directions := ''; AU_PassChar := #0; AU_MaxLen := 0; AU_PreCleanList := FALSE; AU_DataListText := ''; IF (AU_TextOrList = TRUE) THEN BEGIN AU_DataText := opm_Edit_AskUserData.Text; AU_ListItem := -1; END ELSE BEGIN AU_DataText := opm_ComboBox_AskUserList.Text; AU_ListItem := opm_ComboBox_AskUserList.ItemIndex; END; end; end.