Jump to content

Blip

Members
  • Posts

    8
  • Joined

  • Last visited

Blip's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I apologize if this has been asked before, but after a good amount of wasted time I think I've come to realize that adding a context menu to an existing Menu isn't possible. I have a basic "File" "Edit" "Help" type Menu and I'd really like to add a context menus to them. Does anyone know if a UDF for this ability has been created? Also, I've had trouble getting tooltips to work with Menus as well. I found a UDF that enables menuitem tool tips but still not tooltips for the menus themselves. Thanks for any help.
  2. I should have done more research, just found $GUI_EVENT_DROPPED. Sorry to have wasted anyone's time. Still could use some advise for the manual user entries though. Or at least an idea of what is best practice for updating a GUI after a user entry.
  3. I have a GUI that has two input fields. The first one uses a button that users can hit to browse to a file, and that file and path get plugged into the first field. When the Browse button is used my second input field does some _PathSplit magic to grab just the file name from that selected file, so the result would look something like: First GUICtrlCreateInput: [C:FilePathSelectedFileName.exe] [browse for file button] Second GUICtrlCreateInput: [selectedFileName] This whole setup works really well, but my first input field also has the option for a file to be dragged and dropped. I'm trying to find some way to have the second field update and do a _SplitPath when a file is dragged into the first field. (Less importantly, I'd like to find a way to have the second input update if the first field losses focus - for those users manually entering path & file in the first field.) Any help or a point in the right direction would be amazing. Thanks.
  4. This'll make the truncating job a lot easier, wasn't aware of _PathSplit. I suppose this is a decent work around if no built in browse function does this already, thanks.
  5. I'm trying to have a dialog open that can browse to a file location and grab a file name, like "Program.exe". FileOpenDialog is able to capture the full path + file name, like "C:\program files\program\program.exe" but I'm looking for a similar browse ability that gets and stores just the file name. I've looked through almost all the File functions and perhaps I've overlooked it but I can't find something that does this, I'm hoping someone can point me in the right direction. In a pinch I guess I can truncate the product of FileOpenDialog but I'd like to avoid that if possible. Thanks for any assistance.
  6. I found a semi-workaround because I embarrassingly was having trouble adding the new entry I wanted to the iniReadSection array. I captured the existing entries with iniReadSection... Deleted the section with IniDelete... Recreated the section name with FileWrite, added the new Entry with FileWrite, then dumped the captured array underneath it with FileWrite. $sIni = "Scriptsmenu.ini" $Sec = InputBox("Section to edit", "Section:") $New = InputBox("Entry to add", "Entry:") Local $var = IniReadSection($sIni, $Sec) IniDelete($sIni, $Sec) Local $file = FileOpen($sIni, 1) FileWrite($file, "[" & $Sec & "]" & @CRLF) FileWrite($file, "Item=" & $New & @CRLF) For $i = 1 To $var[0][0] FileWrite($file, $var[$i][0] & "=" & $var[$i][1] & @CRLF) Next FileClose($file) I'm still pretty bad working with arrays. I can create them from scratch, or pull them from something like iniReadSection. I run into serious trouble when I try to tinker with adding something to an array after it's been created. This solution will do for now, but if anyone can easily explain how I would add an extra value to that iniReadSection array I'd love to know how to do it in the future. This would also probably make alphabetizing the section much easier too (I'm guessing?).
  7. I guess I'll have to go that route then, thanks. I'm still open to other suggestions if they're out there though. Thanks again.
  8. I'm trying to create a function that adds an additional key and value to an existing .ini section. The existing ini would look something like: [Programs] item=Program item=Application item=Exe I have a simple GUI with a field and a button. The button triggers a function which I would like to add the input from the field into a new line under the [Programs] section in the existing ini. So if were to type in "NewValue" into the field and press the button, it should make the existing ini look like: [Programs] item=Program item=Application item=Exe item=NewValue The problem is, iniWrite seems to just overwrite the first existing occurance of the item value making the ini look like: [Programs] item=NewValue item=Application item=Exe The iniSectionWrite seems to just overwrite the existing section entirely leaving this: [Programs] item=NewValue I'm probably over looking some better function to use, and I'd like to avoid having to capture an array of all the existing keys and rewriting them back into a new section with iniSectionWrite. Ideally, I'd like to add that new line even if the existing key and value combo already exists under that section. In theory, if I pushed the button 5 times with the same value in the field, it would add 5 identical lines to that section. I'd appreciate any help.
×
×
  • Create New...